[web2py] Re: table field with reference to other in read-only mode doesn't appear right
This should be fixed in trunk (and nightly build).Please give it a try and confirm. Massimo On Jan 30, 7:46 am, szimszon wrote: > I wonder if somebody could help me. > > Here is my Field: > > Field( 'updated_by', db.auth_user, > writable = False ) > > CRUD rendered it in form "None" but the record has a value 1 and I > have user in auth_user.id=1 > > If I modify the Field to: > > Field( 'updated_by', db.auth_user, > writable = False , > requires = IS_EMPTY_OR( IS_IN_DB( db, > db.auth_user.id, '% > (first_name)s' ) ) ) > > The result is "1" and not the first_name value. > > If I modify the Field to: > > Field( 'updated_by', db.auth_user) > > The result is a list with all the auth_user rows :-o > > With the Field like this: > > Field( 'updated_by', db.auth_user, > requires = IS_EMPTY_OR( IS_IN_DB( db, > db.auth_user.id, '% > (first_name)s' ) ) ) > > There is a result list with all the first_name values... > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
Now, there is a programming error in nightly build (source version) [pgsql]: Traceback (most recent call last): File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ default.py", line 77, in File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in self._caller = lambda f: f() File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ default.py", line 52, in user return dict( form = auth() ) File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in __call__ return self.login() File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login self.log_event(log % self.user) File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in log_event origin=origin, user_id=user_id) File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert return self._db._adapter.insert(self,self._listify(fields)) File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert raise e ProgrammingError: column "origin" specified more than once LINE 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... ^ Error snapshot help (column "origin" specified more than once LINE 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... ^ ) On jan. 30, 16:08, Massimo Di Pierro wrote: > This should be fixed in trunk (and nightly build).Please give it a try > and confirm. > > Massimo > > On Jan 30, 7:46 am, szimszon wrote: > > > > > > > > > I wonder if somebody could help me. > > > Here is my Field: > > > Field( 'updated_by', db.auth_user, > > writable = False ) > > > CRUD rendered it in form "None" but the record has a value 1 and I > > have user in auth_user.id=1 > > > If I modify the Field to: > > > Field( 'updated_by', db.auth_user, > > writable = False , > > requires = IS_EMPTY_OR( IS_IN_DB( > > db, db.auth_user.id, '% > > (first_name)s' ) ) ) > > > The result is "1" and not the first_name value. > > > If I modify the Field to: > > > Field( 'updated_by', db.auth_user) > > > The result is a list with all the auth_user rows :-o > > > With the Field like this: > > > Field( 'updated_by', db.auth_user, > > requires = IS_EMPTY_OR( IS_IN_DB( > > db, db.auth_user.id, '% > > (first_name)s' ) ) ) > > > There is a result list with all the first_name values... > > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
do you have a custom auth_user table? How does it look like? On Jan 30, 11:29 am, szimszon wrote: > Now, there is a programming error in nightly build (source version) > [pgsql]: > > Traceback (most recent call last): > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > restricted > exec ccode in environment > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > default.py", line 77, in > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > self._caller = lambda f: f() > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > default.py", line 52, in user > return dict( form = auth() ) > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > __call__ > return self.login() > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > self.log_event(log % self.user) > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > log_event > origin=origin, user_id=user_id) > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > return self._db._adapter.insert(self,self._listify(fields)) > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > raise e > ProgrammingError: column "origin" specified more than once > LINE > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > ^ > > Error snapshot help > > (column "origin" specified more > than once LINE > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > ^ ) > > On jan. 30, 16:08, Massimo Di Pierro > wrote: > > > > > > > > > This should be fixed in trunk (and nightly build).Please give it a try > > and confirm. > > > Massimo > > > On Jan 30, 7:46 am, szimszon wrote: > > > > I wonder if somebody could help me. > > > > Here is my Field: > > > > Field( 'updated_by', db.auth_user, > > > writable = False ) > > > > CRUD rendered it in form "None" but the record has a value 1 and I > > > have user in auth_user.id=1 > > > > If I modify the Field to: > > > > Field( 'updated_by', db.auth_user, > > > writable = False , > > > requires = IS_EMPTY_OR( IS_IN_DB( > > > db, db.auth_user.id, '% > > > (first_name)s' ) ) ) > > > > The result is "1" and not the first_name value. > > > > If I modify the Field to: > > > > Field( 'updated_by', db.auth_user) > > > > The result is a list with all the auth_user rows :-o > > > > With the Field like this: > > > > Field( 'updated_by', db.auth_user, > > > requires = IS_EMPTY_OR( IS_IN_DB( > > > db, db.auth_user.id, '% > > > (first_name)s' ) ) ) > > > > There is a result list with all the first_name values... > > > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
No... from gluon.tools import * auth = Auth( globals(), db ) # authentication/ authorization auth.settings.hmac_key = 'sha512:144104...c136' auth.define_tables() # creates all needed tables from gluon.contrib.login_methods.basic_auth import basic_auth from gluon.contrib.login_methods.cas_auth import CasAuth auth.settings.actions_disabled.append( 'register' ) try: auth.settings.login_form = CasAuth() auth.settings.login_form.settings( globals(), urlbase = "https:// cas...hu/cas/cas" ) except: auth.settings.login_form = CasAuth( globals(), urlbase = "https:// cas...hu/cas/cas" ) crud = Crud( globals(), db ) # for CRUD helpers using auth service = Service( globals() ) # for json, xml, jsonrpc, xmlrpc, amfrpc crud.settings.auth = auth # enforces authorization on crud crud.settings.logger = auth crud.messages.delete_label = T( 'Törlés' ) mail = Mail() # mailer mail.settings.server = 'localhost:25'# your SMTP server mail.settings.sender = 'raktar-dontre...@in...y.hu' # your email On jan. 30, 19:33, Massimo Di Pierro wrote: > do you have a custom auth_user table? How does it look like? > > On Jan 30, 11:29 am, szimszon wrote: > > > > > > > > > Now, there is a programming error in nightly build (source version) > > [pgsql]: > > > Traceback (most recent call last): > > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > > restricted > > exec ccode in environment > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > default.py", line 77, in > > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > > > self._caller = lambda f: f() > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > default.py", line 52, in user > > return dict( form = auth() ) > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > > __call__ > > return self.login() > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > > self.log_event(log % self.user) > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > > log_event > > origin=origin, user_id=user_id) > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > > return self._db._adapter.insert(self,self._listify(fields)) > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > > raise e > > ProgrammingError: column "origin" specified more than once > > LINE > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > ^ > > > Error snapshot help > > > (column "origin" specified more > > than once LINE > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > ^ ) > > > On jan. 30, 16:08, Massimo Di Pierro > > wrote: > > > > This should be fixed in trunk (and nightly build).Please give it a try > > > and confirm. > > > > Massimo > > > > On Jan 30, 7:46 am, szimszon wrote: > > > > > I wonder if somebody could help me. > > > > > Here is my Field: > > > > > Field( 'updated_by', db.auth_user, > > > > writable = False ) > > > > > CRUD rendered it in form "None" but the record has a value 1 and I > > > > have user in auth_user.id=1 > > > > > If I modify the Field to: > > > > > Field( 'updated_by', db.auth_user, > > > > writable = False , > > > > requires = IS_EMPTY_OR( > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > (first_name)s' ) ) ) > > > > > The result is "1" and not the first_name value. > > > > > If I modify the Field to: > > > > > Field( 'updated_by', db.auth_user) > > > > > The result is a list with all the auth_user rows :-o > > > > > With the Field like this: > > > > > Field( 'updated_by', db.auth_user, > > > > requires = IS_EMPTY_OR( > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > (first_name)s' ) ) ) > > > > > There is a result list with all the first_name values... > > > > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
I cannot reproduce this. Can you help me? Can you edit gluon/dal.py and the function _listify, add a print statement before it returns. Try reproduce the error. What does it print? On Jan 30, 11:29 am, szimszon wrote: > Now, there is a programming error in nightly build (source version) > [pgsql]: > > Traceback (most recent call last): > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > restricted > exec ccode in environment > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > default.py", line 77, in > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > self._caller = lambda f: f() > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > default.py", line 52, in user > return dict( form = auth() ) > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > __call__ > return self.login() > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > self.log_event(log % self.user) > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > log_event > origin=origin, user_id=user_id) > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > return self._db._adapter.insert(self,self._listify(fields)) > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > raise e > ProgrammingError: column "origin" specified more than once > LINE > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > ^ > > Error snapshot help > > (column "origin" specified more > than once LINE > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > ^ ) > > On jan. 30, 16:08, Massimo Di Pierro > wrote: > > > > > > > > > This should be fixed in trunk (and nightly build).Please give it a try > > and confirm. > > > Massimo > > > On Jan 30, 7:46 am, szimszon wrote: > > > > I wonder if somebody could help me. > > > > Here is my Field: > > > > Field( 'updated_by', db.auth_user, > > > writable = False ) > > > > CRUD rendered it in form "None" but the record has a value 1 and I > > > have user in auth_user.id=1 > > > > If I modify the Field to: > > > > Field( 'updated_by', db.auth_user, > > > writable = False , > > > requires = IS_EMPTY_OR( IS_IN_DB( > > > db, db.auth_user.id, '% > > > (first_name)s' ) ) ) > > > > The result is "1" and not the first_name value. > > > > If I modify the Field to: > > > > Field( 'updated_by', db.auth_user) > > > > The result is a list with all the auth_user rows :-o > > > > With the Field like this: > > > > Field( 'updated_by', db.auth_user, > > > requires = IS_EMPTY_OR( IS_IN_DB( > > > db, db.auth_user.id, '% > > > (first_name)s' ) ) ) > > > > There is a result list with all the first_name values... > > > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
The error is constant... After the print statement: [(, 'auth'), (, 1), (, 'User 1 Logged-in'), (, datetime.datetime(2011, 1, 31, 7, 43, 21, 687801)), (, '10.1.0.100'), (, 'auth'), (, '')] On jan. 31, 00:18, Massimo Di Pierro wrote: > I cannot reproduce this. Can you help me? > > Can you edit gluon/dal.py and the function _listify, add a print > statement before it returns. Try reproduce the error. What does it > print? > > On Jan 30, 11:29 am, szimszon wrote: > > > > > > > > > Now, there is a programming error in nightly build (source version) > > [pgsql]: > > > Traceback (most recent call last): > > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > > restricted > > exec ccode in environment > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > default.py", line 77, in > > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > > > self._caller = lambda f: f() > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > default.py", line 52, in user > > return dict( form = auth() ) > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > > __call__ > > return self.login() > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > > self.log_event(log % self.user) > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > > log_event > > origin=origin, user_id=user_id) > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > > return self._db._adapter.insert(self,self._listify(fields)) > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > > raise e > > ProgrammingError: column "origin" specified more than once > > LINE > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > ^ > > > Error snapshot help > > > (column "origin" specified more > > than once LINE > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > ^ ) > > > On jan. 30, 16:08, Massimo Di Pierro > > wrote: > > > > This should be fixed in trunk (and nightly build).Please give it a try > > > and confirm. > > > > Massimo > > > > On Jan 30, 7:46 am, szimszon wrote: > > > > > I wonder if somebody could help me. > > > > > Here is my Field: > > > > > Field( 'updated_by', db.auth_user, > > > > writable = False ) > > > > > CRUD rendered it in form "None" but the record has a value 1 and I > > > > have user in auth_user.id=1 > > > > > If I modify the Field to: > > > > > Field( 'updated_by', db.auth_user, > > > > writable = False , > > > > requires = IS_EMPTY_OR( > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > (first_name)s' ) ) ) > > > > > The result is "1" and not the first_name value. > > > > > If I modify the Field to: > > > > > Field( 'updated_by', db.auth_user) > > > > > The result is a list with all the auth_user rows :-o > > > > > With the Field like this: > > > > > Field( 'updated_by', db.auth_user, > > > > requires = IS_EMPTY_OR( > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > (first_name)s' ) ) ) > > > > > There is a result list with all the first_name values... > > > > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
Can I help you in other way? If you mind you could send me a modified dal.py with lots of logging (I have no console output - apache2 and mod_wsgi) but if you put import syslog syslog.syslog... than I can deliver you all the logs... On jan. 31, 07:46, szimszon wrote: > The error is constant... > > After the print statement: > > [(, 'auth'), ( object at 0x9f9fc0c>, 1), (, > 'User 1 Logged-in'), (, > datetime.datetime(2011, 1, 31, 7, 43, 21, 687801)), ( object at 0x9f9fbec>, '10.1.0.100'), ( 0x9f9fe8c>, 'auth'), (, '')] > > On jan. 31, 00:18, Massimo Di Pierro > wrote: > > > > > > > > > I cannot reproduce this. Can you help me? > > > Can you edit gluon/dal.py and the function _listify, add a print > > statement before it returns. Try reproduce the error. What does it > > print? > > > On Jan 30, 11:29 am, szimszon wrote: > > > > Now, there is a programming error in nightly build (source version) > > > [pgsql]: > > > > Traceback (most recent call last): > > > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > > > restricted > > > exec ccode in environment > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > default.py", line 77, in > > > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > > > > > self._caller = lambda f: f() > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > default.py", line 52, in user > > > return dict( form = auth() ) > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > > > __call__ > > > return self.login() > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > > > self.log_event(log % self.user) > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > > > log_event > > > origin=origin, user_id=user_id) > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > > > return self._db._adapter.insert(self,self._listify(fields)) > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > > > raise e > > > ProgrammingError: column "origin" specified more than once > > > LINE > > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > > ^ > > > > Error snapshot help > > > > (column "origin" specified more > > > than once LINE > > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > > ^ ) > > > > On jan. 30, 16:08, Massimo Di Pierro > > > wrote: > > > > > This should be fixed in trunk (and nightly build).Please give it a try > > > > and confirm. > > > > > Massimo > > > > > On Jan 30, 7:46 am, szimszon wrote: > > > > > > I wonder if somebody could help me. > > > > > > Here is my Field: > > > > > > Field( 'updated_by', db.auth_user, > > > > > writable = False ) > > > > > > CRUD rendered it in form "None" but the record has a value 1 and I > > > > > have user in auth_user.id=1 > > > > > > If I modify the Field to: > > > > > > Field( 'updated_by', db.auth_user, > > > > > writable = False , > > > > > requires = IS_EMPTY_OR( > > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > > (first_name)s' ) ) ) > > > > > > The result is "1" and not the first_name value. > > > > > > If I modify the Field to: > > > > > > Field( 'updated_by', db.auth_user) > > > > > > The result is a list with all the auth_user rows :-o > > > > > > With the Field like this: > > > > > > Field( 'updated_by', db.auth_user, > > > > > requires = IS_EMPTY_OR( > > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > > (first_name)s' ) ) ) > > > > > > There is a result list with all the first_name values... > > > > > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
this should now be fixed in trunk. Please check it. On Jan 31, 12:46 am, szimszon wrote: > The error is constant... > > After the print statement: > > [(, 'auth'), ( object at 0x9f9fc0c>, 1), (, > 'User 1 Logged-in'), (, > datetime.datetime(2011, 1, 31, 7, 43, 21, 687801)), ( object at 0x9f9fbec>, '10.1.0.100'), ( 0x9f9fe8c>, 'auth'), (, '')] > > On jan. 31, 00:18, Massimo Di Pierro > wrote: > > > > > > > > > I cannot reproduce this. Can you help me? > > > Can you edit gluon/dal.py and the function _listify, add a print > > statement before it returns. Try reproduce the error. What does it > > print? > > > On Jan 30, 11:29 am, szimszon wrote: > > > > Now, there is a programming error in nightly build (source version) > > > [pgsql]: > > > > Traceback (most recent call last): > > > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > > > restricted > > > exec ccode in environment > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > default.py", line 77, in > > > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > > > > > self._caller = lambda f: f() > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > default.py", line 52, in user > > > return dict( form = auth() ) > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > > > __call__ > > > return self.login() > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > > > self.log_event(log % self.user) > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > > > log_event > > > origin=origin, user_id=user_id) > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > > > return self._db._adapter.insert(self,self._listify(fields)) > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > > > raise e > > > ProgrammingError: column "origin" specified more than once > > > LINE > > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > > ^ > > > > Error snapshot help > > > > (column "origin" specified more > > > than once LINE > > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > > ^ ) > > > > On jan. 30, 16:08, Massimo Di Pierro > > > wrote: > > > > > This should be fixed in trunk (and nightly build).Please give it a try > > > > and confirm. > > > > > Massimo > > > > > On Jan 30, 7:46 am, szimszon wrote: > > > > > > I wonder if somebody could help me. > > > > > > Here is my Field: > > > > > > Field( 'updated_by', db.auth_user, > > > > > writable = False ) > > > > > > CRUD rendered it in form "None" but the record has a value 1 and I > > > > > have user in auth_user.id=1 > > > > > > If I modify the Field to: > > > > > > Field( 'updated_by', db.auth_user, > > > > > writable = False , > > > > > requires = IS_EMPTY_OR( > > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > > (first_name)s' ) ) ) > > > > > > The result is "1" and not the first_name value. > > > > > > If I modify the Field to: > > > > > > Field( 'updated_by', db.auth_user) > > > > > > The result is a list with all the auth_user rows :-o > > > > > > With the Field like this: > > > > > > Field( 'updated_by', db.auth_user, > > > > > requires = IS_EMPTY_OR( > > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > > (first_name)s' ) ) ) > > > > > > There is a result list with all the first_name values... > > > > > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
No :( There is the same error: web2py™ Version 1.91.6 (2011-01-30 15:16:26) Traceback Traceback (most recent call last): File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ default.py", line 77, in File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in self._caller = lambda f: f() File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ default.py", line 52, in user return dict( form = auth() ) File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in __call__ return self.login() File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login self.log_event(log % self.user) File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in log_event origin=origin, user_id=user_id) File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert return self._db._adapter.insert(self,self._listify(fields)) File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert raise e ProgrammingError: column "origin" specified more than once LINE 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... ^ Error snapshot help (column "origin" specified more than once LINE 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... ^ ) File /home/szimszon_nfs/web2py/gluon/dal.py in insert at line 3934 Function argument list (self=, 'id': }>, **fields={'description': 'User 1 Logged-in', 'origin': 'auth', 'user_id': 1}) Code listing def _insert(self, **fields): return self._db._adapter._insert(self,self._listify(fields)) def insert(self, **fields): return self._db._adapter.insert(self,self._listify(fields)) def bulk_insert(self, items): """ here items is a list of dictionaries Variables self._listify , 'id': }>> fields {'description': 'User 1 Logged-in', 'origin': 'auth', 'user_id': 1} self, 'id': }> self._db._adapter self._db._adapter.insert> self._db}>}> File /home/szimszon_nfs/web2py/gluon/dal.py in insert at line 707 Function argument list (self=, table=, 'id': }>, fields=[(, 'auth'), (, 1), (, 'User 1 Logged-in'), (, datetime.datetime(2011, 2, 1, 7, 41, 5, 86992)), (, '10.1.0.100'), (, 'auth'), (, '')]) Code listing try: self.execute(query) except Exception, e: if isinstance(e,self.integrity_error_class()): return None raise e if hasattr(table,'_primarykey'): return dict( [ (k,fields[k]) for k in table._primarykey ]) id = self.lastrowid(table) if not isinstance(id,int): Variables e ProgrammingError('column "origin" specified more... ^\n',) On febr. 1, 03:07, Massimo Di Pierro wrote: > this should now be fixed in trunk. Please check it. > > On Jan 31, 12:46 am, szimszon wrote: > > > > > > > > > The error is constant... > > > After the print statement: > > > [(, 'auth'), ( > object at 0x9f9fc0c>, 1), (, > > 'User 1 Logged-in'), (, > > datetime.datetime(2011, 1, 31, 7, 43, 21, 687801)), ( > object at 0x9f9fbec>, '10.1.0.100'), ( > 0x9f9fe8c>, 'auth'), (, '')] > > > On jan. 31, 00:18, Massimo Di Pierro > > wrote: > > > > I cannot reproduce this. Can you help me? > > > > Can you edit gluon/dal.py and the function _listify, add a print > > > statement before it returns. Try reproduce the error. What does it > > > print? > > > > On Jan 30, 11:29 am, szimszon wrote: > > > > > Now, there is a programming error in nightly build (source version) > > > > [pgsql]: > > > > > Traceback (most recent call last): > > > > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > > > > restricted > > > > exec ccode in environment > > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > > default.py", line 77, in > > > > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > > > > > > > self._caller = lambda f: f() > > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > > default.py", line 52, in user > > > > return dict( form = auth() ) > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > > > > __call__ > > > > return self.login() > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > > > > self.log_event(log % self.user) > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > > > > log_event > > > > origin=origin, user_id=user_id) > > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > > > > return self._db._adapter.insert(self,self._listify(fields)) > > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > > > > raise e > > > > ProgrammingError: column "origin" specified more than once > > > > LINE > > > > 1: ...t(origin,user_id,desc
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
My fault. I tried with nightly and not trunk :-o Trunk works just fine :) thank you! On febr. 1, 03:07, Massimo Di Pierro wrote: > this should now be fixed in trunk. Please check it. > > On Jan 31, 12:46 am, szimszon wrote: > > > > > > > > > The error is constant... > > > After the print statement: > > > [(, 'auth'), ( > object at 0x9f9fc0c>, 1), (, > > 'User 1 Logged-in'), (, > > datetime.datetime(2011, 1, 31, 7, 43, 21, 687801)), ( > object at 0x9f9fbec>, '10.1.0.100'), ( > 0x9f9fe8c>, 'auth'), (, '')] > > > On jan. 31, 00:18, Massimo Di Pierro > > wrote: > > > > I cannot reproduce this. Can you help me? > > > > Can you edit gluon/dal.py and the function _listify, add a print > > > statement before it returns. Try reproduce the error. What does it > > > print? > > > > On Jan 30, 11:29 am, szimszon wrote: > > > > > Now, there is a programming error in nightly build (source version) > > > > [pgsql]: > > > > > Traceback (most recent call last): > > > > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > > > > restricted > > > > exec ccode in environment > > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > > default.py", line 77, in > > > > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > > > > > > > self._caller = lambda f: f() > > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > > default.py", line 52, in user > > > > return dict( form = auth() ) > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > > > > __call__ > > > > return self.login() > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > > > > self.log_event(log % self.user) > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > > > > log_event > > > > origin=origin, user_id=user_id) > > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > > > > return self._db._adapter.insert(self,self._listify(fields)) > > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > > > > raise e > > > > ProgrammingError: column "origin" specified more than once > > > > LINE > > > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > > > ^ > > > > > Error snapshot help > > > > > (column "origin" specified more > > > > than once LINE > > > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > > > ^ ) > > > > > On jan. 30, 16:08, Massimo Di Pierro > > > > wrote: > > > > > > This should be fixed in trunk (and nightly build).Please give it a try > > > > > and confirm. > > > > > > Massimo > > > > > > On Jan 30, 7:46 am, szimszon wrote: > > > > > > > I wonder if somebody could help me. > > > > > > > Here is my Field: > > > > > > > Field( 'updated_by', db.auth_user, > > > > > > writable = False ) > > > > > > > CRUD rendered it in form "None" but the record has a value 1 and I > > > > > > have user in auth_user.id=1 > > > > > > > If I modify the Field to: > > > > > > > Field( 'updated_by', db.auth_user, > > > > > > writable = False , > > > > > > requires = IS_EMPTY_OR( > > > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > > > (first_name)s' ) ) ) > > > > > > > The result is "1" and not the first_name value. > > > > > > > If I modify the Field to: > > > > > > > Field( 'updated_by', db.auth_user) > > > > > > > The result is a list with all the auth_user rows :-o > > > > > > > With the Field like this: > > > > > > > Field( 'updated_by', db.auth_user, > > > > > > requires = IS_EMPTY_OR( > > > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > > > (first_name)s' ) ) ) > > > > > > > There is a result list with all the first_name values... > > > > > > > Version 1.91.6 (2011-01-03 17:55:14)
[web2py] Re: table field with reference to other in read-only mode doesn't appear right
Oh yes and the original error isn't present anymore... BigTNX :) On febr. 1, 07:57, szimszon wrote: > My fault. I tried with nightly and not trunk :-o > > Trunk works just fine :) thank you! > > On febr. 1, 03:07, Massimo Di Pierro > wrote: > > > > > > > > > this should now be fixed in trunk. Please check it. > > > On Jan 31, 12:46 am, szimszon wrote: > > > > The error is constant... > > > > After the print statement: > > > > [(, 'auth'), ( > > object at 0x9f9fc0c>, 1), (, > > > 'User 1 Logged-in'), (, > > > datetime.datetime(2011, 1, 31, 7, 43, 21, 687801)), ( > > object at 0x9f9fbec>, '10.1.0.100'), ( > > 0x9f9fe8c>, 'auth'), (, '')] > > > > On jan. 31, 00:18, Massimo Di Pierro > > > wrote: > > > > > I cannot reproduce this. Can you help me? > > > > > Can you edit gluon/dal.py and the function _listify, add a print > > > > statement before it returns. Try reproduce the error. What does it > > > > print? > > > > > On Jan 30, 11:29 am, szimszon wrote: > > > > > > Now, there is a programming error in nightly build (source version) > > > > > [pgsql]: > > > > > > Traceback (most recent call last): > > > > > File "/home/szimszon_nfs/web2py/gluon/restricted.py", line 188, in > > > > > restricted > > > > > exec ccode in environment > > > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > > > default.py", line 77, in > > > > > File "/home/szimszon_nfs/web2py/gluon/globals.py", line 95, in > > > > > > > > > > self._caller = lambda f: f() > > > > > File "/home/szimszon_nfs/web2py/applications/raktar/controllers/ > > > > > default.py", line 52, in user > > > > > return dict( form = auth() ) > > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1034, in > > > > > __call__ > > > > > return self.login() > > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1527, in login > > > > > self.log_event(log % self.user) > > > > > File "/home/szimszon_nfs/web2py/gluon/tools.py", line 1277, in > > > > > log_event > > > > > origin=origin, user_id=user_id) > > > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 3934, in insert > > > > > return self._db._adapter.insert(self,self._listify(fields)) > > > > > File "/home/szimszon_nfs/web2py/gluon/dal.py", line 707, in insert > > > > > raise e > > > > > ProgrammingError: column "origin" specified more than once > > > > > LINE > > > > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > > > > ^ > > > > > > Error snapshot help > > > > > > (column "origin" specified more > > > > > than once LINE > > > > > 1: ...t(origin,user_id,description,time_stamp,client_ip,origin,des... > > > > > ^ ) > > > > > > On jan. 30, 16:08, Massimo Di Pierro > > > > > wrote: > > > > > > > This should be fixed in trunk (and nightly build).Please give it a > > > > > > try > > > > > > and confirm. > > > > > > > Massimo > > > > > > > On Jan 30, 7:46 am, szimszon wrote: > > > > > > > > I wonder if somebody could help me. > > > > > > > > Here is my Field: > > > > > > > > Field( 'updated_by', db.auth_user, > > > > > > > writable = False ) > > > > > > > > CRUD rendered it in form "None" but the record has a value 1 and I > > > > > > > have user in auth_user.id=1 > > > > > > > > If I modify the Field to: > > > > > > > > Field( 'updated_by', db.auth_user, > > > > > > > writable = False , > > > > > > > requires = IS_EMPTY_OR( > > > > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > > > > (first_name)s' ) ) ) > > > > > > > > The result is "1" and not the first_name value. > > > > > > > > If I modify the Field to: > > > > > > > > Field( 'updated_by', db.auth_user) > > > > > > > > The result is a list with all the auth_user rows :-o > > > > > > > > With the Field like this: > > > > > > > > Field( 'updated_by', db.auth_user, > > > > > > > requires = IS_EMPTY_OR( > > > > > > > IS_IN_DB( db, db.auth_user.id, '% > > > > > > > (first_name)s' ) ) ) > > > > > > > > There is a result list with all the first_name values... > > > > > > > > Version 1.91.6 (2011-01-03 17:55:14)