I do not understand:

db.define_table('userlist',
    Field('fname','string',notnull=True),
    Field('lname','string',notnull=True),
    format='%(fname)s %(lname)s (%(id)s)')

db.define_table('name',
    Field('name','string',notnull=True),
    Field('date','date',notnull=True),
    Field('userselect','list:reference tablelist',notnull=True))


there is no table "tablelist". This

On Nov 5, 11:24 am, Richard Vézina <ml.richard.vez...@gmail.com>
wrote:
> Can't reproduce it in a dedicated app.
>
> But the list:reference doesn't seems to me to work correctly as it was in
> the 1.83.2 in which it was managing a list reprensentation. Now I can't pick
> my stuff from a list like in the attached file I sent yesterday. There is
> only a empty field.
>
> If I try to pass a list of element like : |1|2| it store 0.
>
> Pretty strange behavior to me.
>
> Attached app.
>
> Go to default/create/userlist
> Create some user
> Then go to default/create/name
> See that there is no way to pick the user charged in userlist table
> There is also default/read/name/ID where you can see that there no list
> stored in case you load |1|2| in create view.
>
> Regards
>
> Richard
>
> On Thu, Nov 4, 2010 at 4:33 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > Can you please post the model, the controller and the steps to
> > reproduce the problem?
>
> > Massimo
>
> > On Nov 4, 3:29 pm, Richard Vézina <ml.richard.vez...@gmail.com> wrote:
> > > More input on the problem.
>
> > > It happen when the date validator is activated. The refresh form not
> > expose
> > > the normal list field. I reproduce the problem with Chrome and Firefox
> > > systematically when the date is forgot and required by the model.
>
> > > I attach screenshot of the problem :
>
> > > Capture.png = when date validator is activated
>
> > > Capature-1.png = normal list selector field
>
> > > The main problem is that the id is splited.
>
> > > Richard
>
> > > On Thu, Nov 4, 2010 at 1:57 PM, Richard Vézina
> > > <ml.richard.vez...@gmail.com>wrote:
>
> > > > Ok I know what the problem has cause :
>
> > > > It seems that the new version is splitting id into single number :
>
> > > > 35 = |3|5|
> > > > 94 = |9|4|
>
> > > > Instead of :
>
> > > > 94 = |94|
>
> > > > Richard
>
> > > > On Thu, Nov 4, 2010 at 12:33 PM, Richard Vézina <
> > > > ml.richard.vez...@gmail.com> wrote:
>
> > > >> Hello,
>
> > > >> I get this error... I have no clue why I get it. I think it not coming
> > > >> from my app :
>
> > > >>  Traceback (most recent call last):
>
> > > >>   File "/home/www-data/web2py/gluon/restricted.py", line 188, in
> > restricted
>
> > > >>     exec ccode in environment
>
> > > >>   File "/home/www-data/web2py/applications/init/views/appadmin.html" <
> >https://127.0.0.1/admin/default/edit/init/views/appadmin.html>, line 192,
> > in <module>
>
> > > >>     {{=form}}
>
> > > >>   File "/home/www-data/web2py/gluon/sqlhtml.py", line 1273, in
> > __init__
>
> > > >>     r = field.represent(r)
>
> > > >>   File "/home/www-data/web2py/gluon/sql.py", line 518, in <lambda>
>
> > > >>     (ids and ', '.join(f(r,id) for id in ids) or '')
>
> > > >> TypeError: sequence item 0: expected string, int found
>
> > > >>  Error snapshot*Detailed traceback description*
>
> > > >>    - Exception: <type 'exceptions.TypeError'>(sequence item 0:
> > expected
> > > >>    string, int found)
> > > >>    - Python 2.6.4: /usr/bin/python
>
> > > >>  File /home/www-data/web2py/gluon/restricted.py in restricted at line
> > 188
> > > >> [ code | arguments | variables ] File
> > > >> /home/www-data/web2py/applications/init/views/appadmin.html in
> > <module> at
> > > >> line 192[ code | arguments | variables ] File
> > > >> /home/www-data/web2py/gluon/sqlhtml.py in __init__ at line 1273[ code
> > |
> > > >> arguments | variables ] File /home/www-data/web2py/gluon/sql.py in
> > > >> <lambda> at line 518[ code | arguments | variables ]
> > > >> *Function argument list: (ids=[9, 4], r=<Table {'first_name':
> > > >> <gluon.sql.Field object at...itials': <gluon.sql.Field object at
> > > >> 0xbb52a50c>}>, f=<function ff at 0xbb1db02c>)*
>
> > > >> 513.
> > > >> 514.
>
> > > >> 515.
> > > >> 516.
>
> > > >> 517.
>
> > > >> 518.
>
> > > >> 519.
>
> > > >> 520.
> > > >> 521.
>
> > > >> 522.
>
> > > >>     elif field._db and field_type.startswith('list:reference') and \
>
> > > >>             field_type.find('.') < 0 and \
>
> > > >>             field_type[15:] in field._db.tables:
>
> > > >>         referenced = field._db[field_type[15:]]
>
> > > >>         field.represent = lambda ids, r=referenced, f=ff: \
>
> > > >>             (ids and ', '.join(f(r,id) for id in ids) or '')
>
> > > >>         if hasattr(referenced, '_format') and referenced._format:
>
> > > >>             requires = validators.IS_IN_DB(field._db,referenced.id,
>
> >  referenced._format,multiple=True)
>
> > > >>             if field.unique:
>
> > > >> *
> > > >> *
>
> > > >> *Richard*
>
> > > >> *
> > > >> *
>
> > >  Capture.png
> > > 10KViewDownload
>
> > >  Capture-1.png
> > > 12KViewDownload
>
>
>
>  web2py.app.applistissue.w2p
> 107KViewDownload

Reply via email to