ok, a lot of questions.
in model
db=SQLDB(...)
from applicaitons.plugin_t2.modules.t2 import T2
t2=T2(request,response,session,cache,T,db)
db.define_table('info',SQLField('person_id',db.t2_person),SQLField('data','text'))
db.info.person_id.default=t2.person_id ## this sets default ownership
db.info.exposed=['data'] ## this make sure owner is not visible in
forms
in controller try update else create the record
@requires_login()
def edit_info():
try: form=t2.update(db.info,db.info.person_id==t2.person_id)
except: form=t2.create(db.info)
return dict(form=form)
you can make a dropdown using
requires=IS_IN_SET(['a','b','c'])
or
requires=IS_IN_DB(db,'table.field','%(field)s')
where table is the table name and field is the field name.
On Nov 6, 5:50 pm, "Wes James" <[EMAIL PROTECTED]> wrote:
> On Thu, Nov 6, 2008 at 4:38 PM, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > sorry, I do not understand. Could you example with a concrete example?
>
> With the puppy app, there is a login user and puppy data. When a
> person logs in and creates a puppy the puppy is associated with that
> user.
>
> In my case, a person logs in - the first time they should just see an
> empty form. They then fill that form out and save it. (could a save
> come right back and show them the form again?) Then they log out and
> come back later to update. When they log in they then should see the
> form with the data they put in.
>
> Also, how do you get drop down lists from db info (separate db( and
> check boxes to be populated from the db (on normal form)?
>
> -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
-~----------~----~----~----~------~----~------~--~---