Optional input parameters?

21 views
Skip to first unread message

Brian Cox

unread,
Mar 26, 2013, 10:33:46 AM3/26/13
to pytho...@googlegroups.com
Hi Christophe,

Forgive me if I am overlooking this somewhere, but is it possible to have input parameters in the "@validate" that are optional? 

Something like this?
    @expose(MessageResponse)
    @validate(unicode, unicode, int, int, int, unicode=None)

I'm still using 0.4 if that makes a difference.

Thanks,
Brian

Christophe de Vienne

unread,
Mar 26, 2013, 10:37:21 AM3/26/13
to pytho...@googlegroups.com
Hi Brian,

Parameters are optionals as soon as they have a default value.

@validate(text, text)
def my_func(mandatory, optional=None):
pass


That said, is there a reason why you did not switch to 0.5b1 ?

Cheers,

Christophe




Le 26/03/2013 15:33, Brian Cox a �crit :
> --
> You received this message because you are subscribed to the Google
> Groups "python-wsme" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to python-wsme...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Brian Cox

unread,
Mar 26, 2013, 11:36:28 AM3/26/13
to pytho...@googlegroups.com
Great, thanks!

We just haven't upgraded yet because we've deployed a system running 0.4 that we don't have complete control over. We do have a chance to update the system coming up and we'll probably update to 0.5 then.



On Tuesday, March 26, 2013 7:37:21 AM UTC-7, Christophe de Vienne wrote:
Hi Brian,

Parameters are optionals as soon as they have a default value.

@validate(text, text)
def my_func(mandatory, optional=None):
    pass


That said, is there a reason why you did not switch to 0.5b1 ?

Cheers,

Christophe




Le 26/03/2013 15:33, Brian Cox a �crit :
Reply all
Reply to author
Forward
0 new messages