MRAB python at
Sun Oct 3 05:05:42 CEST 2010

On 03/10/2010 03:29, Hidura wrote:
> 2010/10/2, Niklasro<niklasro 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.

More information about the Python-list mailing list