I have:
db.student.id.default=t2.person_id
in my db.py
but I have a problem. When a student comes and registers that creates
a t2_person record - fine. But then they are logged in and they see
their initial form. If they save some data, all is fine, but if they
don't and another student registers, then saves some data then the
student.id gets out of sync because it is not taking the t2.person_id
for some reason.
it does this
student 1 registers they get t2.person_id=1 - they save data (before
anyone else does) and so student.id is also 1
student 2 registers they get t2.person_id=2 - they don't save data
sudent 3 registers they get t2.person_id=3 - they save data, but the
student.id is set as 2.
Shouldn't the default above have prevented this. It seems the
student.id is just getting set to the next available id when saved.
Would it work better to do:
db.define_table("student",
SQLField("id",default=t2.person_id),
.....
but "id" is already there isn't it?
thx,
-wj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---