[web2py] Re: Insert Failed: Insufficient data left in message

2013-11-06 Thread at
Yes except datetime fields; the all inserted values seem to be ok and datetime fields are evaluated by datetime.now AT On Thursday, 7 November 2013 12:41:55 UTC+5, Paolo Valleri wrote: > > have you checked the variables content of a failure? > Paolo > -- Resources: - http://web2py.com - http:/

[web2py] Re: Insert Failed: Insufficient data left in message

2013-11-06 Thread Paolo Valleri
have you checked the variables content of a failure? Paolo On Thursday, November 7, 2013 8:36:52 AM UTC+1, at wrote: > > Hi, > > Occationally an error is reported stating following problem: > "/home/www-data/web2py/gluon/dal.py", line 8514, in insert\nret = > self._db._adapter.insert(self, s

[web2py] Insert Failed: Insufficient data left in message

2013-11-06 Thread at
Hi, Occationally an error is reported stating following problem: "/home/www-data/web2py/gluon/dal.py", line 8514, in insert\nret = self._db._adapter.insert(self, self._listify(fields))\n File "/home/www-data/web2py/gluon/dal.py", line 1206, in insert\nraise e\nProgrammingError: (\'ERR

Re: [web2py] Re: Databases folder and the files

2013-11-06 Thread Jayadevan M
OK, so I got it wrong. I see the actual SQLs and execution output in sql.log. The SQLs which are 'about to be executed' to get the instance in sync with the definitions in tables.py/db.py etc, can I see them somewhere? On Thu, Nov 7, 2013 at 12:52 PM, Niphlod wrote: > they are created after al

[web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Niphlod
hard ? with DAL it's pretty easy if a module exposes the dbapi just force the driver and implement the connect method and it's usually good to go. I'll test it when I get back home. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] Re: Databases folder and the files

2013-11-06 Thread Niphlod
they are created after altering the tables on the underlying instance, so if any error is found (i.e. the migration is rolled back) they stay the same. On Thursday, November 7, 2013 3:40:53 AM UTC+1, Jayadevan M wrote: > > Thanks. These files get created by web2py *after* it compares the objects

Re: [web2py] Re: User_agent problem after this morning update from the trunk

2013-11-06 Thread Johann Spies
Thanks for the explanation Massimo. Regards Johann On 6 November 2013 16:48, Massimo Di Pierro wrote: > web2py uses to cache user_agent info in session, as dict. Then convert > them to Storage objects ate every http request. This was a waste of time. I > change the code so that they are cached

Re: [web2py] Where to find name of uploaded file during the onvalidation step?

2013-11-06 Thread Russell McMurray
At onvalidation the file is "inside" the form as cStringIO.StringO instance. Specifically: form.vars.{{upload_fieldname}}.file. You can get the contents like this: contents = form.vars.{{upload_fieldname}}.file.getvalue() It is then up to you to throw an error (or not as the case may be) with f

[web2py] Re: After reset password, delete rows from table associated with user

2013-11-06 Thread Mark Li
Thanks for pointing me in the right direction, Stifan. I added this line to the model file: db.auth_user._after_update.append(lambda s: remove_mobile_token(s, db)) and this function in a module def remove_mobile_token(set, db): request = current.request #delete mobile tokens if the

[web2py] jquerymobile not displaying correctly in GAE

2013-11-06 Thread melmg
Hello, I'm using the jquerymobile plugin on my webapp and when I look at it on the jquerymobile demo site locally, it shows correctly: but now that I deployed it to GAE, when I look at it o

Re: [web2py] Re: Databases folder and the files

2013-11-06 Thread Jayadevan M
Thanks. These files get created by web2py *after* it compares the objects declared under models with the objects in the database? On Wed, Nov 6, 2013 at 10:01 PM, Niphlod wrote: > import pickle > table_file = 'applications/theapp/databases/thetablefile.table' > print pickle.load(open(table_fil

[web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Derek
It does look like there is a pure python implementation of TDS called pytds, which may actually work... the hard part would be getting web2py to use it... On Wednesday, November 6, 2013 5:15:57 PM UTC-7, Derek wrote: > > Yea, I'm working on a communication layer for pyodbc or pypyodbc which > w

[web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Derek
Yea, I'm working on a communication layer for pyodbc or pypyodbc which will handle requests with gevent, thus your application should yield properly, but it's not available just yet, and it won't necessarily be a drop-in replacement for pyodbc though. In the meantime, this is usually good enoug

[web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Niphlod
On Thursday, November 7, 2013 12:23:06 AM UTC+1, Derek wrote: > > Ah, if you are on Windows, I would recommend you run it with gevent > instead of rocket, it should be faster than even apache. > > unfortunately it doesn't work as happily as it should: if you're using any non-green module (he's

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Jim Steil
Thanks for all the help. You guys are awesome. Jim On Nov 6, 2013 5:37 PM, "Niphlod" wrote: > or > > @auth.requires_login() > def email_link_redirector(): > if not request.args(0): > raise HTTP(404) > redirect(URL('maintenance', 'tickets', args=['edit', 'ticket', > request

[web2py] Re: can a single component update multiple targets?

2013-11-06 Thread Derek
Cliff, that's exactly how I'd do it, so you can certainly speak for me in this case. On Wednesday, November 6, 2013 3:38:28 PM UTC-7, Cliff Kachinske wrote: > > I can't speak for Derek, but here's how I handle this stuff. > > foo > > > $('#to_be_updated).on('click', function(event){ > ajax('u

Re: [web2py] Re: autocomplete widget to query odbc data sources

2013-11-06 Thread Niphlod
as long as there is a db.define_table(, migrate=False) that describes the table you want to fetch the data from, you're good to go! BTW: you can manage multiple databases with web2py without problems db = DAL('sqlite://storage.db') . db_autocomplete = DAL('db2://') db_autocomplete.define_t

Re: [web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Derek
Yea, the ajax running synchronously - you provide callbacks because they do run asynchronously. To quote the jQuery book: The* first letter in Ajax stands for "asynchronous,"* meaning that the operation occurs in parallel and the order of completion is not guaranteed. The async option to $.aja

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Niphlod
or @auth.requires_login() def email_link_redirector(): if not request.args(0): raise HTTP(404) redirect(URL('maintenance', 'tickets', args=['edit', 'ticket', request.args(0)], user_signature=True)) and send the ticket email with a link to this email_link_redirector/ticketid

Re: [web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Ricardo Pedroso
On Tue, Nov 5, 2013 at 11:53 AM, Andrew Buchan wrote: > Ok, the IT guy has disabled McAffee's "on access" scan for the folders > containing web2py stuff as well as python's installation directory. He > tells me that parts of McAffee other than "on access" scan may still > interfere but there's no

[web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Derek
I'll also add this: look at anyserver.py for how to get it going... also, gevent does monkey.patch_all which means that all your tcp sockets would become async, which means if you are freezing up because a single connection is frozen, that won't be the case with gevent. Your individual connecti

[web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Derek
Ah, if you are on Windows, I would recommend you run it with gevent instead of rocket, it should be faster than even apache. On Monday, November 4, 2013 4:15:56 AM UTC-7, Andrew Buchan wrote: > > Hi, > > I have a serious issue. Got a web2py install running as a service on a > Windows 2003 bo

[web2py] Re: A newbie question about update_or_insert

2013-11-06 Thread Andreas Wienes
I get the point. Thanks for your quick reply! - Andreas Am Mittwoch, 6. November 2013 23:44:14 UTC+1 schrieb Cliff Kachinske: > > form.process does the insertion, so your call to update_or_insert is too > late. > > how about this? > db.define_table('name' Field('name', unique=True, requires=IS_N

[web2py] Re: Module import problem ----> (No module named modules)

2013-11-06 Thread Cliff Kachinske
Do you have __init__.py in your modules folder? On Wednesday, November 6, 2013 2:36:16 PM UTC-5, Niphlod wrote: > > posting what you're trying to import may help us to figure out the cause > and give a solution ^_^ > > >> >> >> >> -- Resources: - http://web2py.com - http://web2py.com/book (Docu

[web2py] Re: A newbie question about update_or_insert

2013-11-06 Thread Cliff Kachinske
form.process does the insertion, so your call to update_or_insert is too late. how about this? db.define_table('name' Field('name', unique=True, requires=IS_NOT_IN_DB(... Look in the "Forms and Validators" chapter of the online manual for the correct syntax for IS_NOT_IN_DB. Look in the "Databa

[web2py] Re: can a single component update multiple targets?

2013-11-06 Thread Cliff Kachinske
I can't speak for Derek, but here's how I handle this stuff. foo $('#to_be_updated).on('click', function(event){ ajax('update_span', [ ], ':eval') ... in the controller: def update_span(): return "$('#to_be_updated').html('fubar');" On Wednesday, November 6, 2013 3:25:11 PM UTC-5, step

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Cliff Kachinske
Something like this: def clean_email_key_table(table) # use dateutil to calculate cutoff_date. 30 days maybe? db(db[table].created_on < cutoff_date).delete() db.define_table('user_email_key', Field('user_id', 'reference auth_user' ), Field('email_key', length=256 ... # this would be a u

[web2py] A newbie question about update_or_insert

2013-11-06 Thread Andreas Wienes
I want to use update_or_insert to insert a value to my DB if it doesn't exist. def add_name(): form = SQLFORM(db.name) if form.process().accepted: db.name.update_or_insert(db.name.name==request.vars.name, name=request.vars.name) return dict(form=form) But it won't work. Nam

[web2py] Re: How to use response.flash() to inform user about current status of a process

2013-11-06 Thread Andreas Wienes
Thanks for your advice Niphlod. I will try it soon and report my results. - Andreas Am Sonntag, 3. November 2013 16:28:37 UTC+1 schrieb Niphlod: > > response.flash is used to set a fixed content into the layout.html > This happens to be a in the scaffolding app. > That being said, you can't upda

Re: [web2py] Re: autocomplete widget to query odbc data sources

2013-11-06 Thread António Ramos
Yes i know how to connect to db2 with or without a dsn I just want to know if i can tweak the autocomplete widget to query directly an external odbc source.In my case a db2. I just want to avoid having to copy some tables to my web2py sqlite because this way i have to update it daily. I think th

Re: [web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Andrew Buchan
Hi Derek, Thanks for replying, I had checked those but the last entry was months old, so that was a dead end. I finally got web2py running on Apache, though it took me till 5 am :-) (ps: if anyone else plans on attempting to install Apache on Windows against MSSQL, I'm happy to help out or write

[web2py] Re: can a single component update multiple targets?

2013-11-06 Thread step
On Wednesday, November 6, 2013 7:55:23 PM UTC+1, Derek wrote: > > You'll most likely need to use ajax() from web2py.js and use 'eval' and > return the javascript to run. > >> Well if I change op() in controllers/archive.py to return a script like this: def op(): status = '' if reque

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Jim Steil
I tried sending the signed link via the email, but that seemed to fail as well. Also have to assume that the person getting the email and navigating to the page is not using the same session as the one sending the email. So, how would you build the signature? I will investigate the redirect optio

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Niphlod
that why then. if the user is only allowed to access the grid WITH the signature, he can't access the same link without the signature (and that's the whole point about signed links). You need to figure out yourself (with your application's demands) what to do (i.e. sending a signed link by mai

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Jim Steil
>From 'The Book': login required by default for data updates By default all the URL generated by the grid are digitally signed and verified. This means one cannot perform certain actions (create, update, delete) without being logged-in. These restrictions can be relaxed: def manage_users():

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Jim Steil
No, the user is always linking with a signature in the app. I think the default for user_signature is True and I'm not overriding it. So, are you telling me that if I want to deep link to the edit page on a SQLFORM.grid then I need to have user_signature = False? If I do that, aren't I giving up

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Niphlod
ok, rolling back a little. if the user is accessing the link without issues without any signature, then it should be able to click on the link and reach the page. This also means that the grid you're publishing has user_signature = False, right ? -- Resources: - http://web2py.com - http://web2p

[web2py] Re: Module import problem ----> (No module named modules)

2013-11-06 Thread Niphlod
posting what you're trying to import may help us to figure out the cause and give a solution ^_^ > > > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) ---

Re: [web2py] Re: Javascript event onchange with Calendar

2013-11-06 Thread Niphlod
nothing has changed event-wise from the "old" web2py.js to the new one (included in web2py >= 2.6.0). "Before web2py 2.6.0" the calendar was hooked as soon as discovered into the page (even if the user didn't click on the field), now instead it is initialized as soon as a user clicks on it. Thi

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Jim Steil
yes, but I'm not sending the signature, am I? -Jim On Wed, Nov 6, 2013 at 1:22 PM, Niphlod wrote: > beware that if the session is renewed (the random uuid changes between > when you send the link and when the user accesses the page) the signature > changes. > > > On Wednesday, November 6, 2013

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Cliff Kachinske
I think grid wants a signature on the URL for add, edit and delete. On Wednesday, November 6, 2013 1:31:28 PM UTC-5, Jim S wrote: > > Yes, it does require you to login if you are not logged in. If not logged > in it takes you to the login page before issuing the 'not authorized' even > though I

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Niphlod
beware that if the session is renewed (the random uuid changes between when you send the link and when the user accesses the page) the signature changes. On Wednesday, November 6, 2013 7:31:28 PM UTC+1, Jim S wrote: > > Yes, it does require you to login if you are not logged in. If not logged

Re: [web2py] Re: autocomplete widget to query odbc data sources

2013-11-06 Thread Derek
Do it the usual way like Niphlod said, the DSN stands for 'Data Source Name' and it's a DSN as defined in the ODBC setup. You'd have to configure that ODBC connection before setting up web2py to connect to it. In Linux, usually you have ODBCconfig, or a sys.odbc.ini file. On Windows, just go in

[web2py] Re: can a single component update multiple targets?

2013-11-06 Thread Derek
You'll most likely need to use ajax() from web2py.js and use 'eval' and return the javascript to run. On Wednesday, November 6, 2013 11:39:16 AM UTC-7, step wrote: > > Can a single component update more than one target? > > I want to click on a link and have it update two targets at once, is this

[web2py] can a single component update multiple targets?

2013-11-06 Thread step
Can a single component update more than one target? I want to click on a link and have it update two targets at once, is this possible? The single-target cookbook is relatively simple: views/default/index.load: {{=A(('fix it'),_href=URL(c='archive',f='op',args='fix'),cid='archive_op_fix')}}

[web2py] Module import problem ----> (No module named modules)

2013-11-06 Thread floydpetrus
Ticket ID 127.0.0.1.2013-11-06.17-54-22.fa80574c-c662-4f65-a86f-45ddf4baf428 No module named modules Version web2py™ Version 2.7.3-stable+timestamp.2013.10.11.23.12.01 Python Python 2.7.3: /usr/bin/python (prefix: /usr) Hi there fellow web2py-users I'm trying out web2py for a smaller

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Jim Steil
Yes, it does require you to login if you are not logged in. If not logged in it takes you to the login page before issuing the 'not authorized' even though I'm logging in... In maintenance.py: @auth.requires_login() def tickets(): . -Jim On Wed, Nov 6, 2013 at 12:28 PM, Richard Vézina

Re: [web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Richard Vézina
Did you decorate your tickets function? @auth.requires_login() Richard On Wed, Nov 6, 2013 at 1:10 PM, Jim S wrote: > I'm sending an email with a link back to an edit page on SQLFORM.grid like > this: > > ticket = db.ticket(ticketId) > > subject = 'Ticket %s - %s' % (ticket.ticketId,

Re: [web2py] Re: Javascript event onchange with Calendar

2013-11-06 Thread Derek
Well, I can't say if it's a bug or not, Niphlod would be able to determine that. He made the change to fix something. I can't find an issue that corresponds with this change though. The only thing I could suggest then is to use the calendar setup yourself, and instead of adding the web2py.js au

[web2py] Sending mail with links to SQLFORM.grid edit page - not authorized

2013-11-06 Thread Jim S
I'm sending an email with a link back to an edit page on SQLFORM.grid like this: ticket = db.ticket(ticketId) subject = 'Ticket %s - %s' % (ticket.ticketId, ticket.summary) user = db.auth_user(ticket.assignedId) to = user.email message = '%s has assigned to %s to you.-%s

Re: [web2py] Re: Javascript event onchange with Calendar

2013-11-06 Thread José Luis Redrejo
Derek, thank you for the info. I could not guess it was so complicated. I don't like to modify files that are part of the framework as they will change with future updates. Don't you think this is a bug that should be fixed in web2py? 2013/11/6 Derek : > You can't do that, because of recent change

[web2py] Re: Javascript event onchange with Calendar

2013-11-06 Thread Derek
You can't do that, because of recent changes in web2py.js source code by niphlod. The 'calendar' js does have a method that would work after the date was changed. https://github.com/web2py/web2py/commit/cd30382c0ebefeeef1149214acb36e5fd6c93469#diff-51450f2685f2ecf74b1835b4fc2bc16cR182 (see line 1

[web2py] Re: Web2py freezing on live deployment!

2013-11-06 Thread Derek
Check the logs, find the last line in the log - that's probably what caused the freeze. Check your logging.conf to find out where the logs are kept. On Tuesday, November 5, 2013 1:59:43 PM UTC-7, Andrew Buchan wrote: > > Update: > > I made a copy of the web2py installation on a new server (still

[web2py] Where to find name of uploaded file during the onvalidation step?

2013-11-06 Thread weheh
I'm doing a file upload using SQLFORM and a field of type upload. I want to intercept the file during onvalidation and do some file manipulation before saving. While in the onvalidation routine I can see the original filename and form.vars.filename.file, which I can read. I'm wondering whether

[web2py] Re: Databases folder and the files

2013-11-06 Thread Niphlod
import pickle table_file = 'applications/theapp/databases/thetablefile.table' print pickle.load(open(table_file)) it's just a dict holding a key for each field, with as value another dict of attributes of that field. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

Re: [web2py] Re: xmlrpc security

2013-11-06 Thread kwebb
Here is my current solution: First, I optionally obtain the client cert and set environment variables in apache: SSLVerifyClient optional SSLVerifyDepth 2 SSLOptions +StdE This allows login via browers to not require a client cert (using Auth instead) Then I read up on decorators and cre

[web2py] Re: chat-tornado in web2py using websocket_messaging.py

2013-11-06 Thread dederocks
Thanks for the feedback -- I'm still using 2.5.1. Le mercredi 6 novembre 2013 15:49:11 UTC+1, Massimo Di Pierro a écrit : > > This should be fixed in trunk, no? > > On Wednesday, 6 November 2013 06:48:58 UTC-6, dederocks wrote: >> >> Hi, >> I don't know if this could have solved your issue, but I

[web2py] Re: retrieve auth_group.role from auth_user table

2013-11-06 Thread 黄祥
brilliant, it's work as expected now, thank you so much Cliff and Johann. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) ---

Re: [web2py] OnSelect how to?

2013-11-06 Thread Richard Vézina
Wait, you just want to redirect on a list base on a drop box selected item? What do yo do with the list? Select again, or just consult? For the latter you can easely do it with 2 LOAD component into a container page. One component is your form with your dropbox and the other component containt yo

[web2py] Re: FORM and one to many

2013-11-06 Thread Gael Princivalle
Fantastic, thanks a lot. Now I have to make the same kind of form but for "Many to many" relations. I'm gone try to do it by myself with your kinds informations, have a nice day. Il giorno mercoledì 6 novembre 2013 15:25:01 UTC+1, 黄祥 ha scritto: > > hi, sorry, i missed that out, i think you can

Re: [web2py] OnSelect how to?

2013-11-06 Thread Richard Vézina
But I may be fooled by the title... I am not sure now if it a replacement for lazy option plugin - http://dev.s-cubism.com/plugin_lazy_options_widget - or not... I thought it was, but I didn't test it yet. But I use lazy_option_widget, and I broke it dependency to the other plugin... If you want t

Re: [web2py] OnSelect how to?

2013-11-06 Thread Richard Vézina
No, this : https://groups.google.com/d/msg/web2py/HhK8o0RBDNc/Ralcjl_q5MQJ Conditional field... 2.5.1 - New style virtual fields in grid - Conditional fields (experimental) db.table.field.show_if = db.table.otherfield==True or db.table.field.show_if = db.table.otherfiel.contains(valu

[web2py] Re: retrieve auth_group.role from auth_user table

2013-11-06 Thread Cliff Kachinske
I would refer you to the Fine Manual, where you will find things like auth.has_permission, auth.has_membership, @auth.requires_permission(), @auth.requires_membership() If those don't do what you want, you can always join tables as Johann suggested. The join would look like this: ( (db.auth_us

Re: [web2py] retrieve auth_group.role from auth_user table

2013-11-06 Thread 黄祥
> What are you trying to achieve? > what i want to achieve is in registration form using sqlform, the doctor field is showing drop down menu form field list of user that have roles doctor. What is the function of db.registration.requires... in this context? > db.registration.requires is fo

Re: [web2py] Re: User_agent problem after this morning update from the trunk

2013-11-06 Thread Massimo Di Pierro
web2py uses to cache user_agent info in session, as dict. Then convert them to Storage objects ate every http request. This was a waste of time. I change the code so that they are cached as Storage objects. This is faster but invalidates sessions. On Wednesday, 6 November 2013 00:35:27 UTC-6, J

[web2py] Re: chat-tornado in web2py using websocket_messaging.py

2013-11-06 Thread Massimo Di Pierro
This should be fixed in trunk, no? On Wednesday, 6 November 2013 06:48:58 UTC-6, dederocks wrote: > > Hi, > I don't know if this could have solved your issue, but I had the same > problem using Chromium on Ubuntu. This dissapeared when using Chrome on the > same platform -- I have no idea why!

[web2py] Deployment recipes chapter in book needs new handlers directory

2013-11-06 Thread ptressel
Are we still reporting errata for the book in the forum? (Wasn't sure whether to revive the old thread that asked this.) If so... The deployment recipes chapter in the book... http://web2py.com/books/default/chapter/29/13/deployment-recipes ...has references to wsgihandler.py and fcgihandler.py

[web2py] Re: FORM and one to many

2013-11-06 Thread 黄祥
hi, sorry, i missed that out, i think you can achieve it by modified your tables into : db.define_table('categories', Field('description_en', requires=IS_NOT_EMPTY()), Field('description_it', requires=IS_NOT_EMPTY()), Field('code', requires=IS_NOT_EMPTY()), format = '%

Re: [web2py] retrieve auth_group.role from auth_user table

2013-11-06 Thread Johann Spies
On 6 November 2013 15:33, 黄祥 wrote: > btw, i modified the code that you give before into : > models/db_wizard_4_registration.py > > if auth.user: > roles = [x.role for x in db((db.registration.doctor == > db.auth_membership.user_id) & (db.auth_membership.group_id == > db.auth_group.id)).select(db

Re: [web2py] Re: [OT] For those who like CLI tools. dopy - todo list on terminal, based on DAL

2013-11-06 Thread Richard Vézina
It seems file storage oriented http://orgmode.org/org.html#TODO-Items TODO item are part of note... They are flagged TODO note... Do you have an idea how to we could bring this into the database? Also, I would like to have these tools available for each user... So, we talk about an Org file per

[web2py] Re: FORM and one to many

2013-11-06 Thread Gael Princivalle
Thanks Stifan now I can crate/modify/delete. Do you know also how I can do it ? >I just would like to make a form for "models" table where I will be able to set the "models.category_id" field choosing by the "categories.description_it" field. Il giorno mercoledì 6 novembre 2013 13:40:15 UTC+1,

Re: [web2py] Re: [OT] For those who like CLI tools. dopy - todo list on terminal, based on DAL

2013-11-06 Thread Richard Vézina
Hello Michele, Thanks for sharing this. This is a big lib. Richard On Tue, Nov 5, 2013 at 7:14 PM, Michele Comitini wrote: > The message from Bruno is 2yrs old? > Cool > IMHO we should also include some of the org-mode tools: > http://orgmode.org/worg/org-tools/index.html if we like TODOs th

Re: [web2py] retrieve auth_group.role from auth_user table

2013-11-06 Thread 黄祥
btw, i modified the code that you give before into : models/db_wizard_4_registration.py if auth.user: roles = [x.role for x in db((db.registration.doctor == db.auth_membership.user_id) & (db.auth_membership.group_id == db.auth_group.id)).select(db.auth_group.role)] db.registration.doctor.require

Re: [web2py] retrieve auth_group.role from auth_user table

2013-11-06 Thread 黄祥
the auth tables row contents are : auth_group.id auth_group.role auth_group.description 1 Admin Admin 2 Cashier Cashier 3 Doctor Doctor auth_membership.id auth_membership.user_id auth_membership.group_id 1 1 1 2 1 2 3 2 2 4 3 3 auth_user.id auth_user.first_name auth_user.last_name a

[web2py] Re: After reset password, delete rows from table associated with user

2013-11-06 Thread 黄祥
i think you can achieve it using after_update callback. define after_update function for auth_user to delete the mobile_tokens row that associated with user. ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks best regards, stifan -- Re

[web2py] Re: chat-tornado in web2py using websocket_messaging.py

2013-11-06 Thread dederocks
Hi, I don't know if this could have solved your issue, but I had the same problem using Chromium on Ubuntu. This dissapeared when using Chrome on the same platform -- I have no idea why! Le samedi 5 octobre 2013 00:42:17 UTC+2, Junior Phanter a écrit : > > greetings , > sorry my bad english , I

[web2py] Re: FORM and one to many

2013-11-06 Thread 黄祥
> I've set "editable=True, deletable=True, create=True" and I cannot do any > of these three actions. > please add @auth.requires_login() before edit_models function, because user login required by default for data modification (create, edit, delete). ref : http://web2py.com/books/default/ch

Re: [web2py] retrieve auth_group.role from auth_user table

2013-11-06 Thread Johann Spies
Use the admin interface to browse the auth tables and see what is in them. Regards Johann On 6 November 2013 14:29, 黄祥 wrote: > thank you so much for your hints, Johann, when i test it not work no error > occured. i can achieve it by define another table called role, make > auth_user table ref

Re: [web2py] retrieve auth_group.role from auth_user table

2013-11-06 Thread 黄祥
thank you so much for your hints, Johann, when i test it not work no error occured. i can achieve it by define another table called role, make auth_user table reference to 'role' table, and set requries on registration table query to auth_user table that have roles table == 'Doctor'. don't know

[web2py] FORM and one to many

2013-11-06 Thread Gael Princivalle
Hi. I'm still searching to make a really simple form with these tables, one to many relation. Here is my db: #ONE db.define_table('categories', Field('description_en', requires=IS_NOT_EMPTY()), Field('description_it', requires=IS_NOT_EMPTY()), Field('code', requires=I