Yes, that's along the lines of what I'm looking for; however, I'll need it to
be in the database due to the fact that I'm going to loop through that list of
requests with a for-loop and call a function on each one.
The function adds that value to a field in the db.when I tried to require it in
Well you should always validate whatever you get from the users. In that
validation step you can do that.
A possible way to validate it would be to do something like:
ids, error = IS_LIST_OF(IS_INT_IN_RANGE(minimum=1),
maximum=YOUR_MAX_NUMBER_OF_IDS)(request.vars.ids.split(','))
if error:
That is exactly the piece of code I needed! I'll let you know how it goes when
I try it out. Is there any way to limit the number of vars entered?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/
Well you can send more than one arg. If you really want to send a list
though I would not use args and use vars. A simple enough solution would be
to send a string with commas separating the values like "1,2,3,4,5" and
then in the controller you would do something like
db.auth_user.id.belongs(r
Thanks! That fixed an error. However the big problem is capturing multiple args
and storing them in a list so I can access them with a for loop. Is this
possible?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https:/
Your query db.auth_user==arg is wrong. You need to compare with a field in
auth_ser. You probably want something like db.auth_user.id==arg
quinta-feira, 20 de Outubro de 2016 às 07:36:05 UTC+1, Jaimee S escreveu:
>
> Hello all,
>
> I have a list of users on my page. I'm trying to click one user
6 matches
Mail list logo