hm, it seems that i must redive down to the code that i've provide above.
in my code above the company is automatic generate using populate before i
populate the membership, group and user that will cause the created_by is
not filled. you can also remove the populate first to make it simple first.
then trying to rebuild the database from scratch and use your code.
you can also cross check it via web2py database admistration or web2py
shell the value of company.created_by is None.
p.s.
my populate function for database is just for effiency in my testing, you
can delete this part in db.py:
from gluon.contrib.populate import populate
if db(db.auth_user).isempty():
# company
db.company.insert(company_name = 'svc shop', website = '
http://stifix.com')
# group
auth.add_group('Manager', 'Manager')
auth.add_group('Admin', 'Admin')
# membership
auth.add_membership('1', '1')
auth.add_membership('2', '1')
auth.add_membership('2', '2')
# user
db.auth_user.bulk_insert([{'first_name' : 'Manager', 'last_name' :
'Manager',
'email' : '[email protected]',
'password' :
db.auth_user.password.validate('password')[0],
'gender' : 'Male', 'address' : 'Address',
'zip' : '11111',
'city' : 'Jakarta', 'country' : 'Indonesia',
'phone' : '1',
'company' : 1},
{'first_name' : 'Admin', 'last_name' :
'Admin',
'email' : '[email protected]',
'password' :
db.auth_user.password.validate('password')[0],
'gender' : 'Male', 'address' : 'Address',
'zip' : '11111',
'city' : 'Jakarta', 'country' : 'Indonesia',
'phone' : '2',
'company' : 1}])
--
---
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.