sorry for being unclear.
I want to assign a parkingspot_code for each user_name in either a form or
a grid and populate it with some other data from the people db
The db.parking table contains:
db.define_table('parking',
Field('parkingspot_code', 'string', unique=True),
Field('used', 'boolean', default=False))
I think I either need to togle the boolean to true if a code is used or I
need to select the first record in the db, copy the code value and delete
the record. The parkingspot_code's are pre generated and 1 time use only.
The resulting form or grid is stored in an other table
I hope this clarifies it a bit.
On Friday, December 13, 2013 6:16:44 PM UTC+1, Leonel Câmara wrote:
>
> You need to be more clear with what you're trying to do, I also don't know
> what the hell is in db.parking table or in db.people. This makes it very
> difficult to help you.
>
> BTW you could just do this to get a list of persons:
>
> persons = db(db.people.id.belongs(session.people.keys())).select()
>
>
>
> Sexta-feira, 13 de Dezembro de 2013 12:04:43 UTC, Ivo escreveu:
>>
>> I have a list containing record id's and need to select those records
>> from a table. then I need to count how many different values are contained
>> in the fields and for each select the first record of an other table.
>>
>> ids = session.people.keys()
>> persons = {}
>>
>> for id in ids: persons[id]=db(db.people.id==id).select()[0]
>> person_list[]
>> for id,person in persons.items():
>> person=people.user_name
>> person_list.append(person)
>>
>>
>> now I want retrieve the first record, with a bool set to False, from
>> db.parking for each.
>> db.parking records contain a bool which I want to toggle to true
>>
>>
>>
>>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.