OH!
You need to realize one thing:   web2py EXECUTES your models -

db.docs_categories.name.requires....

must appear AFTER the db.define_table    which defines docs_categories....

Try to arrange your code to account for this - then see what you get.

On Mon, Nov 17, 2008 at 5:39 PM, pigmej <[EMAIL PROTECTED]> wrote:

>
> so....
>
> Any single error. Just nothing select in Category dropdown if I
> generate SQLFORM(db.docs_pages_ver,values,showid = False). All other
> dropdown's are selected ( author and parrent ) but not this one....
>
> Part of model (it's enough?):
> http://wklej.to/bpL
>
>
> On Nov 18, 12:28 am, mdipierro <[EMAIL PROTECTED]> wrote:
> > what error do you get? can I see the model?
> >
> > On Nov 17, 4:00 pm, pigmej <[EMAIL PROTECTED]> wrote:
> >
> > > Did not works.
> >
> > > On Nov 17, 10:26 pm, mdipierro <[EMAIL PROTECTED]> wrote:
> >
> > > > Do not know whitout lookig at models but try replace
> >
> > > > db.docs_pages_ver.category.requires=IS_NULL_OR(IS_IN_DB
> > > > (db,'docs_categories.id','docs_categories.name
> ',error_message="..."))
> >
> > > > with
> >
> > > > db.docs_pages_ver.category.requires=IS_NULL_OR(IS_IN_DB
> > > > (db,'docs_categories.id','%(id)s',error_message="..."))
> >
> > > > then try replace %(id)s with %(name)s
> >
> > > > On Nov 17, 3:14 pm, pigmej <[EMAIL PROTECTED]> wrote:
> >
> > > > > Controler:
> >
> > > > > def test():
> > > > >     values=db(db.docs_pages_ver.id==47).select()[0]
> > > > >     return SQLFORM(db.docs_pages_ver,values,showid = False)
> >
> > > > > model:
> > > > > db.docs_pages_ver.category.requires=IS_NULL_OR(IS_IN_DB
> > > > > (db,'docs_categories.id','docs_categories.name
> ',error_message="..."))
> > > > > db.docs_pages_ver.author.requires=IS_IN_DB
> > > > > (db,'users.id','users.nick',error_message="...")
> > > > > db.docs_pages_ver.parrent.requires=IS_NULL_OR(IS_IN_DB
> > > > > (db,'docs_pages.id','docs_pages.title',error_message="..."))
> > > > > ...
> >
> > > > > And in output everything is ok except category field. All fields
> are
> > > > > selected correctly, except this one.
> > > > > In category field there is nothing selected. There are the same
> kind
> > > > > of relations etc.
> >
> > > > > I have no idea what's wrong
> >
> > > > > Btw.
> >
> > > > > return values.category returns an correct integer ( it exists in
> > > > > db.category.id )
> >
> > > > > Any ideas ?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to