[web2py] Re: switching tabs in built in editor...

2015-11-17 Thread Edward Shave
Ok, so I'm guessing tabs are a web2py feature rather than belonging to the codemirror. So could someone give me a pointer to where in the source a click event is assigned to the tabs. I'd like to switch tabs using ctrl-tab which doesn't appear to do anything else at present. -- Resources: -

[web2py] Re: exporting to csv

2015-11-17 Thread lucas
nice job, any idea how to make it a tab delimited file instead of comma? lucas -- 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) --- You received this message

[web2py] what is simplest way to show paragraph break in user-created content?

2015-11-17 Thread Alex Glaros
I'd like to allow only paragraph line breaks in user-created content Am looking for the simplest way, so therefore would like to avoid CKEditor and Markmin, or use them in a way that doesn't force me to enable XML-risk related injection in editor Content will be in regular w2p text type field.

[web2py] Determine which login method was successful.

2015-11-17 Thread Jonathan R
Hi, I'm currently using two sources for my authentication ( two different ldap servers): auth.settings.login_methods=[auth_ldap(server one,options 1), auth_ldap(server two, options 2)] My concern is to find out which one was successful when the user logged in and store this information (usi

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Yoel Benitez Fonseca
Thanks, both of u... aw i have solved my issue ... thanks 2015-11-17 14:43 GMT-05:00, Niphlod : > BTW for uber-technical: every backend EXCEPT postgresql commits > automatically when asked to alter the structure of the db (being it table > creation or whatever else) implicitely. Also, web2py's com

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Niphlod
BTW for uber-technical: every backend EXCEPT postgresql commits automatically when asked to alter the structure of the db (being it table creation or whatever else) implicitely. Also, web2py's commits "explicitely" for every "structure modification". On Tuesday, November 17, 2015 at 8:35:02 PM

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Anthony
On Tuesday, November 17, 2015 at 12:35:31 PM UTC-5, Yoel Benitez Fonseca wrote: > > Side question: in a module, like in this example, i don't need to call > commit() for the table to be created ? > This may depend on the RDBMS, but I think in general you don't need to commit a create table. In

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Yoel Benitez Fonseca
Side question: in a module, like in this example, i don't need to call commit() for the table to be created ? 2015-11-17 12:29 GMT-05:00, Yoel Benitez Fonseca : > sorry Anthony, it is just an adaptation of my original code: > > --- > from gluon import * > import categ_model > > m_fields = list() >

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Yoel Benitez Fonseca
sorry Anthony, it is just an adaptation of my original code: --- from gluon import * import categ_model m_fields = list() fld_name = Field('name', 'string') fld_categ = Field('categ_id', 'reference categories') m_fields.append(fld_name) m_fields.append(fld_categ) def define_table(): db = c

[web2py] Re: fields and table definition on modules

2015-11-17 Thread Anthony
> > def define_table(): > if not hasattr(db, 'my_model'): > db.define_table('my_model', *m_fields) > db.commit() > The above refers to "db", but that is not defined anywhere. Where does that come from? Note, you cannot define objects such as db at the top level of a modu

[web2py] Re: update_or_insert - Calculation when updating

2015-11-17 Thread Anthony
> > def index(): > form = SQLFORM(db.tr_items) > if form.process().accepted: > item_in_out = form.vars.item > amount_in_out = form.vars.amount > row = db.products_summary(product=item_in_out) > if row==None: > db.products_summary.insert(product=i

[web2py] fields and table definition on modules

2015-11-17 Thread Yoel Benitez Fonseca
h! all, Suppose i have this code in a app module: --- from gluon import * m_fields = list() fld_name = Field('name', 'string') fld_categ = Field('categ_id', 'reference categories') m_fields.append(fld_name) m_fields.append(fld_categ) def define_table(): if not hasattr(db, 'my_model'):

[web2py] Re: Field set the default value +1 on insert

2015-11-17 Thread Craig Matthews
The following is something that I have used in MySQL. MySQL statement: CREATE TABLE IF NOT EXISTS autonumbering ( Year char(4) not null default '', Type varchar(10) not null default '', IDint(11) not null auto_increment, Notes varchar(64) not null d

[web2py] Re: update_or_insert - Calculation when updating

2015-11-17 Thread Anthony
> Error message #3 >> >> No error message - this overwrites cumulative amount to the amount >> entered by the user, no memory. >> > > Python doesn't have the increment assignment operator, so number 3 is > being taken as > > cumulative_amount = NULL + form.vars.amount > > Python does allow incr

[web2py] Re: upload file path

2015-11-17 Thread Manuele Pesenti
Il 17/11/15 14:36, Manuele Pesenti ha scritto: > doh! I beg your pardon mail was sent before it was finished... I meant > > path_to_file = os.path.join(db.mytable.archivio.uploadfolder, > row.archivio.aplit('.')[-1][:2], row.archivio) Uhm I've looked a bit in the code and I think I've found the rig

[web2py] Re: upload file path

2015-11-17 Thread Manuele Pesenti
Il 17/11/15 14:29, Manuele Pesenti ha scritto: > maybe something like: > > path_to_file = os.path.join(db.mytable.archivio.uploadfolder, , > row.archivio) doh! I beg your pardon mail was sent before it was finished... I meant path_to_file = os.path.join(db.mytable.archivio.uploadfolder, row.archiv

[web2py] upload file path

2015-11-17 Thread Manuele Pesenti
Hi! What's the right way of rebuilding file path of any record of my table with an upload field like: Field("archivio", "upload", uploadfolder=archive_upload_path, uploadseparate=True) where archive_upload_path = os.path.join(request.folder,'uploads/archives') maybe something like: path_to_file

[web2py] Re: update_or_insert - Calculation when updating

2015-11-17 Thread RedBeard
I think I have it: Do you think this is the best way of doing this?? Many thanks again!! Controller: def index(): form = SQLFORM(db.tr_items) if form.process().accepted: item_in_out = form.vars.item amount_in_out = form.vars.amount row = db.products_summary(produ

[web2py] Re: Opportunities for deadlock in scheduler.py send_heartbeat?

2015-11-17 Thread Niphlod
how many workers you have and what heartbeat are you using ? it's no news that the scheduler_worker table is the most "congested" because it's where most of the IPC happens. That's why I should release a version that does IPC on redis, but alas, I didn't find the time yet to polish the code. B

[web2py] Re: How to cope with schema changes on Prod

2015-11-17 Thread Niphlod
there are actually two branches of the deal: - when dal migrations work out of the box - when they don't Assuming the usual "work on dev, push to QA, test QA, if everything is ok push to PROD" workflow, you'd catch "when they don't" on QA. when they work out of the box, is pretty damn easy: push

[web2py] Re: update_or_insert - Calculation when updating

2015-11-17 Thread RedBeard
Hey dps, Thanks for your reply. It is definitely getting closer, you're right, the reference was a good idea, I hadn't put it in because if a tr_items, item doesn't exist in product I wanted it to be added. I now have: Model: db.define_table('products_summary', Field('product

Re: [web2py] Production - making redirections on default index with parameters (maybe with nginx)

2015-11-17 Thread Kiran Subbaraman
There is an example in the book related to redirection: http://web2py.com/books/default/chapter/29/04/the-core?search=routes#Pattern-based-system A less elegant way would be to: Using routes.py, map the /myc to the path /app/controller/func. In the func(), redirect('url path to company/myc'). Th