[web2py] Re: Drop down not showing

2013-12-27 Thread Massimo Di Pierro
It is hard to help. You posted lots of code. Your traceback mentions model (or field) use_company but you did not post this model. ValueError: invalid literal for long() with base 10: 'user_company' Can you post a minimal action to reproduce the problem? Can you reproduce the problem if you rem

[web2py] Re: Drop down not showing

2013-12-27 Thread Michel Hayek
Please any help guys? -- *This e-mail is confidential and may also be privileged. If you are not the intended **recipient, please notify the sender immediately, delete it from your system and do **not copy, disseminate, distribute or disclose any information contained therein.* -- Resourc

[web2py] Re: Drop down not showing

2013-12-19 Thread Dave S
On Thursday, December 19, 2013 6:35:00 AM UTC-8, Michel Hayek wrote: > > Please any help on this issue?? > > Well, I don't see where it is happening just from looking at your code snipped from the 16th, but somewhere there's an attempt to convert your DAL reference to a long(). Is there a trac

[web2py] Re: Drop down not showing

2013-12-19 Thread Michel Hayek
Please any help on this issue?? Thanks -- *This e-mail is confidential and may also be privileged. If you are not the intended **recipient, please notify the sender immediately, delete it from your system and do **not copy, disseminate, distribute or disclose any information contained ther

[web2py] Re: Drop down not showing

2013-12-16 Thread Michel Hayek
I got another error now invalid literal for long() with base 10: 'user_company' *def dupe_check(form):if db((db.company_user.user_id==request.args(-1)) & (db.company_user.company_id==form.vars.company_id)).count(): form.errors['company_id'] = 'Company already associated with this

[web2py] Re: Drop down not showing

2013-12-16 Thread Cliff Kachinske
My bad. :( Too much typing today. On Monday, December 16, 2013 10:34:08 PM UTC-5, Massimo Di Pierro wrote: > > form.process(dupe_check).accepted: > > *should be* > > orm.process(onvalidation=dupe_check).accepted: > > > On Monday, 16 December 2013 20:04:02 UTC-6, Michel Hayek wrote: >> >> I'm gett

[web2py] Re: Drop down not showing

2013-12-16 Thread Massimo Di Pierro
form.process(dupe_check).accepted: *should be* orm.process(onvalidation=dupe_check).accepted: On Monday, 16 December 2013 20:04:02 UTC-6, Michel Hayek wrote: > > I'm getting an error on this (*the error is " 'exceptions.TypeError'> process() takes exactly 1 argument (2 given)" **on > if form.

[web2py] Re: Drop down not showing

2013-12-16 Thread Michel Hayek
I'm getting an error on this (*the error is " process() takes exactly 1 argument (2 given)" **on if form.process(dupe_check).accepted:*). here is what my files looks like *db.py:* *db.define_table('user_company',* * Field('user_id', 'reference auth_user'),* * Field('company_id', 'reference t

[web2py] Re: Drop down not showing

2013-12-16 Thread Cliff Kachinske
If there's already a link between the user and the company, you want the company to NOT appear in the drop down, right? In order for this to work you have to have the user id. Ordinarily it would be the last item on request.args So, simplifying because I don't enjoy typing all that much, the mo

[web2py] Re: Drop down not showing

2013-12-16 Thread Michel Hayek
Guys, i changed the way of implementing the composite key, now i'm concatenating both fields into 1. *db.define_table('t_user_has_companies',* *Field('unikey', notnull=True,required=True, compute=lambda r: str(r.USER_ID) + str(r.COMP_ID)),* *Field('USER_ID','refe

[web2py] Re: Drop down not showing

2013-12-14 Thread Michel Hayek
Hi Massimo, Here is the table def i'm using for this db.define_table('t_user_has_companies', Field('USER_ID', 'reference auth_user', label='User', writable=True, readable=True, notnull=True, required=True, ondelete='NO ACTION'), Field('COMP_ID', 'reference t_com

[web2py] Re: Drop down not showing

2013-12-14 Thread Massimo Di Pierro
If I understand the problem is that you first_name fields does not show a dropdown of users. This line is incorrect: *Field('first_name', 'reference auth_user', label='User', writable=True, readable=True, notnull=True, required=True, ondelete='NO ACTION', requires=IS_IN_DB(db, db.auth_user, '%

[web2py] Re: Drop down not showing

2013-12-14 Thread Michel Hayek
No luck Stifan, i tried a bunch of stuff nothing worked with me. Any ideas? what you think are my other options? Thanks for your help -- *This e-mail is confidential and may also be privileged. If you are not the intended **recipient, please notify the sender immediately, delete it from yo

[web2py] Re: Drop down not showing

2013-12-13 Thread 黄祥
just a suggestion, why not start your code from simple, like the python philosophy 'simple is better than complex, complex is better than complicated'? after start your code from simple than add the DAL field constructor one by one. e.g. *step 1 : for starting i comment the on_define (for dal f

[web2py] Re: Drop down not showing

2013-12-13 Thread Michel Hayek
Ok here is the new table def. db.define_table('t_user_has_companies1', Field('USER_ID', 'reference auth_user', label='User', writable=True, readable=True, notnull=True, requires=IS_IN_DB(db, db.auth_user, '%(id)s %(first_name)s %(last_name)s')), Field('COMP_ID', 'reference t_c

[web2py] Re: Drop down not showing

2013-12-13 Thread Cliff Kachinske
What is this line all about? db.t_user_has_companies.first_name.requires=IS_NOT_IN_DB(db(db.t_user_has_companies.f_coname==request.vars.f_coname),db.t_user_has_companies.first_name) Also, these lines in your t_user_has_companies table def don't match what you say about them. >>> Field('first_na

[web2py] Re: Drop down not showing

2013-12-13 Thread 黄祥
> > *db.define_table('t_user_has_companies',* > *Field('first_name', 'reference auth_user', label='User', > writable=True, readable=True, notnull=True, required=True, ondelete='NO > ACTION', requires=IS_IN_DB(db, db.auth_user, '%(id)s %(first_name)s > %(last_name)s')),* > *