Niklas R niklas at
Sun Oct 3 13:02:57 CEST 2010

On Oct 3, 3:05 am, MRAB <pyt... at> wrote:
> On 03/10/2010 03:29, Hidura wrote:> 2010/10/2, Niklasro<nikla... at>:
> >> Hello
> >> Getting a web same page with 2 or more possible "states" eg business
> >> part, private part or all parts, can you recommend a way to represent
> >> the states via HTTP GET? Feasible way could be ?business=business, ?
> >> type=business, ?business=true or others. Should I minimize casting the
> >> variable? Which type should I reason, boolen or string? I now use
> >> seemingly arbitrary ?t=w to represent a state which technically works
> >> leaving a more readable and maintainable solution to wish.
>  > Be more specific but i recommend you, use a way in what you be very
>  > explicit eg:part='bussiness' a bool for 3 options it's very diffcult
>  > to handle.
>  >
> I agree. If there are several "states" then use something like
> ?part=business, ?part=private, etc. Use a Boolean only where there are
> (and will only ever be) 2 possible states.

Good point especially since a boolean may expand to get used in three
ways for example a business web may have only 2 states, wanted and for
sale and then later upgrade also to more categories like for rent or
likewise where 3 states are need. Thank you for the replies making me
lean towards keeping what seems to be boolean states more like
ternaries and more flexible.

More information about the Python-list mailing list