[web2py] smartgrid x lazy tables - bug or by design behavior?

2014-02-14 Thread Mirek Zvolský
If I set DAL(..., lazy_tables=True) then smartgrid will not display linked_tables. This occurs always, regardless if linked_tables are explicitly defined. Is it a bug or by design behavior? version is 2.8.2 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: impossible to convert decimal

2014-02-14 Thread Robin Manoli
Oops, you were right actually. I was doing a loop, and of course some values where as you said, empty values. Thanks a lot! :D Den torsdagen den 13:e februari 2014 kl. 20:54:57 UTC+1 skrev Cliff Kachinske: It looks like you have an empty value in the table row where you experience the

[web2py] Re: Javascript runs locally but not when deployed

2014-02-14 Thread Leonel Câmara
What appears in the browser console when you see the deployed version? -- 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 because

[web2py] HTML Parser of uploaded file

2014-02-14 Thread Luca Guerrieri
Goodmorning people, I'm teaching myself web2py and I've a little question for understanding how can i do ... I've a form (becomes from a table) with an upload field i would to upload an html file and I would to parse it in the mean time .. or just after the completition of the operation...

[web2py] Re: logout error

2014-02-14 Thread ajith c t
Hi I updated web2py 2.5 to 2.8, now the login and logout seems to work but with a problem, the login page redirects to errorpage and logout correctly redirects to login page. But my logs are: *** 2014-02-14 10:18:45,224 - DEBUG -

[web2py] Re: What is proper requires= validator for foreign key?

2014-02-14 Thread Mirek Zvolský
Great. Thank you. (of course it would be much easier, if use of explicit requires= will cause nothing with implicit represent=) But in one detail it must be different as your version: If I try Field('parent_id', db.parent, requires=IS_IN_DB(db, db.parent.id), represent=lambda id, r:

[web2py] Re: HTML Parser of uploaded file

2014-02-14 Thread Leonel Câmara
BeautifulSoup http://www.crummy.com/software/BeautifulSoup/ is a common option. -- 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

[web2py] REF: Join query help!

2014-02-14 Thread Teddy Nyambe
I have problem, I would like to have achieve a query which displays the value of the foreign key: db.define_table(owner, Field(owner_name)) db.define_table(dog, Field(dog_name), Field(owner, reference owner)) rs = db(db.owner.id==db.dog.owner).select(db.owner.name, db.owner.name) what i want to

[web2py] manage scheduler result with smartgrid

2014-02-14 Thread Manuele Pesenti
Hi! does anybody can tell me what's wrong in this controller? def task(): if 'view' in request.args: sdb.scheduler_task.vars.represent = lambda v,row: myBEAUTIFY(loads(v), body=PRE) grid = SQLFORM.smartgrid(sdb.scheduler_task, linked_tables=['scheduler_run'],

[web2py] A DAL mssql question. Connection with FreeTDS and Unicode data in a Unicode-only collation problem

2014-02-14 Thread Falk
Hi, I am for the first time messing with mssql dal adapter and are really struggling to get it working to a SQL2008 server.. I have gotten the connection with FreeTDS working When I connect in python with. conn = pyodbc.connect ('DSN=TS;UID=foo;PWD=bar') cursor = conn.cursor()

[web2py] Single form for many to many relationship

2014-02-14 Thread Oleg Marin
Hi! I'm looking for solution for nice single SQLFORM for many to many relationship. For example I have such model: db.define_table('person', Field('name'), Field('position'), Field('office', 'integer')) db.define_table('thing', Field('name'), Field('color')) db.define_table('person_thing',

[web2py] Re: manage scheduler result with smartgrid

2014-02-14 Thread Manuele Pesenti
Il 14/02/14 12:13, Manuele Pesenti ha scritto: Hi! does anybody can tell me what's wrong in this controller? Ok.. thanks to Mirek Zvolský I found that the main problem was linked to that I set up my scheduler db with lazy_tables=True. Now (changed that option to False) for every record the link

[web2py] Cannot access virtual fields within a IS_IN_DB format function?

2014-02-14 Thread Horst Horst
Given this table... translator_format = lambda row: row.custom_name if (row.custom_name and row.custom_name.strip()) else %s - %s %( db.notation(row.source_notation_id).notation_name, db.notation(row.target_notation_id).notation_name) db.define_table(translator, # A

[web2py] Re: REF: Join query help!

2014-02-14 Thread Leonel Câmara
I'm not sure I'm understanding exactly what you're trying to do. You say you want to display the value of the foreign key (which would be an integer) but in your code you seem to be only interested in the names. So this may or may not be what you want. I've found a bug here rs =

[web2py] Re: Cannot access virtual fields within a IS_IN_DB format function?

2014-02-14 Thread Leonel Câmara
def translator_chooser_representation(r): return %s %(r.translator_name()) -- 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] Inputs for multiple records in same view

2014-02-14 Thread Tim Price
Hi, I've got a situation where I need to be able to input data for multiple records simultaneously. Records from the single table below: Model: db.define_table('t_toc_elements', Field('belongs', type='string', label=T('Belongs to work')), Field('name', type='string',

[web2py] A Select Tag Helper Code

2014-02-14 Thread DMK
I wasn't able to find a simple function that would help generate a SELECT tag given a set of options (I did see the OPTION function) so created a simple one and thought it'd be useful to share. I'm new to Python so this may not be very elegant, but it works. The function takes the tag's name

[web2py] IS_IN_DB drop-down for search

2014-02-14 Thread r . ryogesh
Hi, I have a search bar with 2 columns, group and address. form = SQLFORM.factory(Field('ugroup', requires=IS_IN_DB(db, customers.gid', '%(group)s'), label='User group'), Field('address', label='address'), formstyle=divs,

[web2py] Treat Datetime field as Date?

2014-02-14 Thread Tim Nyborg
I'm connecting to an MSSQL 2005 db, which only has the Datetime format (Date was added in 2008). Is there a standard way to treat a Datetime as a Date in web2py for forms and formatting? I've done the following, and it works thus far, but it seems a bit hackish. Field('BirthDte', 'datetime',

[web2py] Form with related model can't validate NULL value

2014-02-14 Thread brahama von
Hi, First time i write to the list. Been googling around and couldn't find a solution that i understand. I am really new to python and web2py. I have this model legacy_db.define_table('courses', Field('name','string'), Field('version','string'), Field('link','string'),

[web2py] web2py secrets video part 2???

2014-02-14 Thread Alan Williams
I have been using videos and tutorials to get me going on web2py. I loved this video: http://pyvideo.org/video/433/pycon-2011--web2py-secrets-tutorial--1-2 I cannot seem to find the 2nd part if there is one. I was wondering if Massimo or anyone else had a link to share? Thanks, Alan --

[web2py] GAE localhost mysql instance

2014-02-14 Thread Juslin Guo
Hi, Can anyone point me to any resource that show me how to use CloudSQL+GAE together with a local mysql development environment on mac..It can't seem to connect to the local mysql for development purposes. I did this: if not request.env.web2py_runtime_gae: db =

[web2py] New to Web2Py: Large Model

2014-02-14 Thread Juslin Guo
Hi, I have an application in PHP with 500 over tables, what's the best way to managed them in Web2Py, without repeating model definitions nor loading them all. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Large Number of Models in Web2py

2014-02-14 Thread Juslin Guo
Hi All, I new to Web2py, comtemplating shifting a 500 over tables PHP Application over... Do you all know where i can learn how to optimize Web2py for large number of models. Is there a way i could define them without having to repeat it, at the same time, not loading all the models. [Sorry if

[web2py] Re: [CLOSED] XMLHttpRequest cannot load https://www..... disallowed for cross-origin request ...

2014-02-14 Thread Umed
why didnt you specify what was a solution On Wednesday, December 18, 2013 4:05:43 PM UTC+5, weheh wrote: Looks like I got it working. The Apache config file wasn't complete, so once I found that issue, the CORS started to function properly. Thanks again for your responses. On Monday,

[web2py] Re: impossible to convert decimal

2014-02-14 Thread r . ryogesh
For 2 decimal precision, you can try, {:.2f}.format(your_value) On Thursday, February 13, 2014 6:49:44 AM UTC-5, Robin Manoli wrote: Hey, I have a decimal in db, for which I tried numerous ways to round to two decimal points, and also to calculate with other numbers. Basically I want to

[web2py] Escaping '%' percent character

2014-02-14 Thread Alejandro Garza Gracia
Hello, I've looked through the documentation and the questions asked but I haven't been able to escape the '%' percent character in a string. I've tried using '\%' and '%%' in a label string, but none has worked so far. I'd appreciate the help. -- Resources: - http://web2py.com -

[web2py] Re: Manual image upload

2014-02-14 Thread mannu kumar
db.mytable.insert(image=db.mytable.image.store(request.vars.image.file, request.vars.image.filename), image_blob = request.vars.image.file.read()) this should work, ref http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#More-on-uploads Note, if the file is to

[web2py] rows.export_to_csv_file and headers

2014-02-14 Thread Gaute Amundsen
Hi. I have noticed that a few people have been frustrated with changing the colnames when exporting to cvs. I have arrived at a fairly compact solution, but perhaps not the most efficient one for large cvs dumps. For the record, and perhaps a bit of criticism, here it is :-) controller

[web2py] Multi player game with Web2py

2014-02-14 Thread clarix
Hi, I find this difficult to formulate so bear with me. I am looking to implement something like a multi player web server, except that instead of games, users would be answering questions or selecting options. The responses of the users would change the evolution of the questions/options

[web2py] iterating form.custom.widget and set _class attribute

2014-02-14 Thread Kök Eksi Bir
As explained in the book I can modify a fields class by setting _class as follows: form.custom.widget.some_field['_class']=input-block-level however when I iterate form.cutom.widget as in following snippet: {{for field in form.custom.widget:}} {{=SPAN(form.custom.label[field])}}

[web2py] auto.py converting mysql schema to web2py models?

2014-02-14 Thread Osman Kazdal
Hello, I searched in group for a tool to convert mysql schema to web2py models. There is talk about an auto.py script but link to that script seems broken. Is there another way to do this now or is it even possible? Osman Kazdal -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Can i still display the search form if i have set searchable=False in the SQLFORM.grid?

2014-02-14 Thread Suhail Thakur
Hi, I need help with SQLFORM.grid, Is there any way i can display the search column even if i have set searchable=False in the SQLFORM.grid. Please let me know. Thank you Suhail -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] web2py large model

2014-02-14 Thread Juslin Guo
Hi, Can anyone advise on this. We have an application on PHP with 500 over tables. Is there any strategy we can adopt when using web2py to manage the models? Coz it seems too much for web2py models structure to chew. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] rows.export_to_csv_file and headers

2014-02-14 Thread Gaute
Hi. I have noticed that a few people have been frustrated with changing the colnames when exporting to cvs. I have arrived at a fairly compact solution, but perhaps not the most efficient one for large cvs dumps. For the record, and perhaps a bit of criticism, here it is :-) controller def

[web2py] Custom Regisration Form

2014-02-14 Thread DMK
I extended the auth_user table with additional profile fields (e.g. phone number, alert preference, etc.) and I'm trying to customize the registration form so that it shows only the desired fields (accomplished per documentation) and display the desired fields in a custom manner, including

[web2py] subscription problems - testing testing

2014-02-14 Thread Gaute Amundsen
Is there a secret first-post moderation policy on this list? I managed to subscribe by email without a hitch, but my posts to the list just disappear into thin air. Help anyone? G. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] rows.export_to_csv_file and headers

2014-02-14 Thread gaute
Hi. I have noticed that a few people have been frustrated with changing the colnames when exporting to cvs. I have arrived at a fairly compact solution, but perhaps not the most efficient one for large cvs dumps. For the record, and perhaps a bit of criticism, here it is :-) controller

[web2py] Re: Broken app IOError: [Errno 13] Permission denied

2014-02-14 Thread Georg Hildebrand
I recently came across this issue to when using wsgi mod. The simple think i needed to do was adding the full root folder to the session path. like: session = web.session.Session(app, web.session.DiskStore('%s/sessions'%global_variables.ROOT), {'count': 0}) -- Resources: - http://web2py.com -

[web2py] IS_IN_DB: how to overwrite validator

2014-02-14 Thread r . ryogesh
Hi, I am re-posting this question, for some reason i don't see my earlier post in this forum. I have a form with 2 fields for search, one text, other drop-down. I want the users to be able to type in the free text or choose from drop-down or both. form = SQLFORM.factory(Field('address',

[web2py] Re: smartgrid x lazy tables - bug or by design behavior?

2014-02-14 Thread Anthony
A given table doesn't know about its linked tables until the tables are fully defined, so you won't get any linked tables automatically when lazy_tables=True. However, the following should work: SQLFORM.smartgrid(db.mytable, linked_tables=[db.othertable1, db.othertable2 ]) Unfortunately, there

[web2py] Re: subscription problems - testing testing

2014-02-14 Thread Anthony
Yes, new members are moderated. You now have permission to post. Anthony On Friday, February 14, 2014 1:12:05 AM UTC-5, Gaute Amundsen wrote: Is there a secret first-post moderation policy on this list? I managed to subscribe by email without a hitch, but my posts to the list just

[web2py] Re: smartgrid x lazy tables - bug or by design behavior?

2014-02-14 Thread Mirek Zvolský
Thank you for perfect answer. I have 2 workarounds: yours --or-- lazy_tables=True. Both are good enough for me for now. Dne pátek, 14. února 2014 14:55:15 UTC+1 Anthony napsal(a): A given table doesn't know about its linked tables until the tables are fully defined, so you won't get any

Re: [web2py] Re: subscription problems - testing testing

2014-02-14 Thread Gaute Amundsen
Thanks :) Now let's hope all my attempted postings don't all show up at once :-) Resubmitting original in a moment. G. On 02/14/2014 03:05 PM, Anthony wrote: Yes, new members are moderated. You now have permission to post. Anthony On Friday, February 14, 2014 1:12:05 AM UTC-5, Gaute

[web2py] rows.export_to_csv_file and headers

2014-02-14 Thread Gaute Amundsen
Hi. I have noticed that a few people have been frustrated with changing the colnames when exporting to cvs. I have arrived at a fairly compact solution, but perhaps not the most efficient one for large cvs dumps. For the record, and perhaps a bit of criticism, here it is :-) controller

[web2py] Re: Cannot access virtual fields within a IS_IN_DB format function?

2014-02-14 Thread Anthony
Not sure if this is the problem, but your virtual field function should refer to row.translator.custom_name rather than row.custom_name. Anthony On Friday, February 14, 2014 8:00:17 AM UTC-5, Horst Horst wrote: Given this table... translator_format = lambda row: row.custom_name if

[web2py] Re: HTML Parser of uploaded file

2014-02-14 Thread Anthony
Why are you using the custom store and retrieve methods? Note, looks like you might be vulnerable to a directory traversal attack (depending on whether you're validating the filename argument passed to the retrieve function). Anthony On Friday, February 14, 2014 5:21:40 AM UTC-5, Luca

[web2py] Re: SQLFORM.factory without a database table

2014-02-14 Thread Anthony
SQLFORM.factory is for generating forms, not grids. The grid requires an actual database, though you can use a SQLite memory database: https://groups.google.com/d/msg/web2py/g4Mon6PvNFc/jytHfEnOXTIJ. Anthony On Friday, February 14, 2014 12:03:33 AM UTC-5, A36_Marty wrote: I would like to

[web2py] Re: What is proper requires= validator for foreign key?

2014-02-14 Thread Anthony
Looks like a bug in smartgrid -- I'll submit a patch. Anthony On Friday, February 14, 2014 5:32:35 AM UTC-5, Mirek Zvolský wrote: Great. Thank you. (of course it would be much easier, if use of explicit requires= will cause nothing with implicit represent=) But in one detail it must be

Re: [web2py] Large Number of Models in Web2py

2014-02-14 Thread Vinicius Assef
You can use conditional models ou a model-less application, importing the ones you want to use. On Wed, Feb 12, 2014 at 2:07 PM, Juslin Guo juslin...@gmail.com wrote: Hi All, I new to Web2py, comtemplating shifting a 500 over tables PHP Application over... Do you all know where i can learn how

Re: [web2py] Re: [CLOSED] XMLHttpRequest cannot load https://www..... disallowed for cross-origin request ...

2014-02-14 Thread Marin Pranjić
https://groups.google.com/forum/#!topic/web2py/0vqUFdr0cjg On Tue, Feb 11, 2014 at 7:52 AM, Umed zarrh...@gmail.com wrote: why didnt you specify what was a solution On Wednesday, December 18, 2013 4:05:43 PM UTC+5, weheh wrote: Looks like I got it working. The Apache config file wasn't

Re: [web2py] Re: SQLFORM.factory without a database table

2014-02-14 Thread Richard Vézina
To insert/update record with .factory() you can do something like that : if form.process().accepted: if condition when update mode is not meat: id = db.underlying_table.insert(field1=form.vars.field1, ...) # You keep the id in cas you need it to insert some information in another

Re: [web2py] Re: Javascript runs locally but not when deployed

2014-02-14 Thread Alex
Everything on the page appears correctly except the widget which does not show at all. Nothing. No hint no error... On Feb 14, 2014, at 5:17 AM, Leonel Câmara leonelcam...@gmail.com wrote: What appears in the browser console when you see the deployed version? -- Resources: -

Re: [web2py] Re: how to embed an image (or another solution) ?

2014-02-14 Thread Stef Mientki
thanks Michele, didn't know about that function On 13-02-14 17:18, Michele Comitini wrote: if you wish to embed images in html, web2py has a little know, but handy function: embed64(data, extension) in your case you coud simply use: img src={{=embed64(data=data, extension='image/png')}}/

Re: [web2py] Escaping '%' percent character

2014-02-14 Thread Martin Weissenboeck
Please show some code. A simple Python example: s = %d%% % 3 s '3%' Regards Martin 2014-02-12 18:28 GMT+01:00 Alejandro Garza Gracia alexgarz...@gmail.com: Hello, I've looked through the documentation and the questions asked but I haven't been able to escape the '%' percent character in

[web2py] Re: how to embed an image (or another solution) ?

2014-02-14 Thread Stef Mientki
thanks Anthony, but I want to browse the image directory, so I don't want to store them in the database. cheers, Stef On 13-02-14 0:48, Anthony wrote: If you use the built-in upload mechanism (i.e., an upload type field in a db table), then files uploaded via that method can be downloaded

[web2py] why is auth.messages.... not working

2014-02-14 Thread Stef Mientki
hello, I want to redefine the texts of the login screen so in models/db.py I've : auth.messages.label_username='Gebruikersnaam' and my login controler: @auth.requires_login() def Inloggen(): redirect ( URL ( Show_Knutselen )) but I keep seeing : username thanks, Stef -- Resources: -

[web2py] Re: Javascript runs locally but not when deployed

2014-02-14 Thread Leonel Câmara
There are no errors at all on the browser javascript console? -- 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 because you are

[web2py] Re: why is auth.messages.... not working

2014-02-14 Thread Anthony
Field labels have to be set before calling auth.define_tables. Is that the case here? Anthony On Friday, February 14, 2014 10:28:21 AM UTC-5, aapaap wrote: hello, I want to redefine the texts of the login screen so in models/db.py I've :

Re: [web2py] Re: Javascript runs locally but not when deployed

2014-02-14 Thread Marin Pranjić
Do you use http or https? What if you try another one? Marin On Fri, Feb 14, 2014 at 4:31 PM, Leonel Câmara leonelcam...@gmail.comwrote: There are no errors at all on the browser javascript console? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Large Number of Models in Web2py

2014-02-14 Thread Anthony
For conditional models, check out http://web2py.com/books/default/chapter/29/04/the-core#Workflow as well as response.models_to_run herehttp://web2py.com/books/default/chapter/29/04/the-core#response. You can also define models within a function or class in a module and import from the

[web2py] Re: A DAL mssql question. Connection with FreeTDS and Unicode data in a Unicode-only collation problem

2014-02-14 Thread Falk
Hi, After some frenzied trying with codecs and views, I finally got it to work. It's a ugly hack, but works for the moment In dal.py I added: (TDS_VERSION=8.0) cnxn = 'SERVER=%s;PORT=%s;DATABASE=%s;UID=%s;PWD=%s*;TDS_VERSION=8.0*;%s' \ % (host, port, db, user, password, urlargs)

[web2py] Re: Large Number of Models in Web2py

2014-02-14 Thread Anthony
Also, if you set DAL(..., lazy_tables=True), that will defer much of the model definition code until the first time the table is accessed within a given request. Though with 500 models, I would probably not rely on lazy_tables exclusively. Anthony On Friday, February 14, 2014 10:38:31 AM

[web2py] Re: Javascript runs locally but not when deployed

2014-02-14 Thread NeoToren
Glenn from PythonAnywhere suggested on StackOverflow it may happen since page is https while widget is http... On Thursday, February 13, 2014 8:16:06 PM UTC-5, NeoToren wrote: I am trying to run a simple javascript that needs to fetch an external URL: script

[web2py] Getting the count of a rows object.

2014-02-14 Thread John Drake
Hello. I'm having a strange problem. I'm trying to get the count of a rows object from a query. Here is the code: def album_show(): album = db.t_album(request.args(0)) songs = db(db.t_song.f_album_id_reference==album.id).select() count = songs.count() return locals() And here

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-14 Thread Michael Ellis
Thanks Michelle and Niphlod for your good advice and explanations. With 4 users connected the load from the ajax call is now down to 40%. I can live with that for this application. FWIW, I decided to adopt a name prefix, no_DAL, to tell web2py not to evaluate the models. That makes my test

[web2py] Re: Getting the count of a rows object.

2014-02-14 Thread Anthony
On Friday, February 14, 2014 10:56:09 AM UTC-5, John Drake wrote: Hello. I'm having a strange problem. I'm trying to get the count of a rows object from a query. Here is the code: def album_show(): album = db.t_album(request.args(0)) songs =

[web2py] Re: why is auth.messages.... not working

2014-02-14 Thread Stef Mientki
thanks Anthony, that did the trick, cheers, Stef On 14-02-14 16:30, Anthony wrote: Field labels have to be set before calling auth.define_tables. Is that the case here? Anthony On Friday, February 14, 2014 10:28:21 AM UTC-5, aapaap wrote: hello, I want to redefine the texts of the

[web2py] Re: Javascript runs locally but not when deployed

2014-02-14 Thread Leonel Câmara
It could, as browser would block it. Just change: script src=http://widgets.aapc.com/countdown/aapc_cdwidgetbox_220.js /script Too: script src=//widgets.aapc.com/countdown/aapc_cdwidgetbox_220.jshttp://widgets.aapc.com/countdown/aapc_cdwidgetbox_220.js /script -- Resources: -

[web2py] ReCaptcha: type 'exceptions.SyntaxError' setting key 'login_catpcha' does not exist?

2014-02-14 Thread User
I want to add a captcha to my login form. Eventually I want this to be conditional based on how many login attemps have been made. However, my first step is to get it to show on the login form. In my default.py controller I have: def user(): function = request.args(0) if function ==

Re: [web2py] Re: REF: Join query help!

2014-02-14 Thread Teddy Nyambe
Apologies if I was not clear, when you do a cross join as in the example you get Rows now, and your code is as I meant it was just a typo, my need is to represent the record set into json object...it works well if there is no join, but when another table comes in the picture the way to access

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-14 Thread greenpoise
requires=IS_IN_SET(SIZES) is what I am using but fails to accept values under 1.0. So, 0.1 to 0.99 prompt the error On Thursday, February 13, 2014 6:48:01 PM UTC-8, Richard wrote: So why not use IS_FLOAT_IN_RANGE()?? requires = IS_FLOAT_IN_RANGE(0, 100, dot=.,

[web2py] Re: Multi player game with Web2py

2014-02-14 Thread samuel bonill
you need implement websocket, in python/web2py you can use Gevent or tornado other more easy alternative is : firebase( https://www.firebase.com ) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] A few suggestions for fixes to the web2py book

2014-02-14 Thread Horst Horst
Meta-question: Should I rather post things like this to the issue tracker? 1. In http://web2py.com/books/default/chapter/32/07/forms-and-validators#Validators, the paragraph IS_IN_SET says: The elements of the set must always be strings unless this validator is preceded by IS_INT_IN_RANGE

[web2py] Re: web2py secrets video part 2???

2014-02-14 Thread samuel bonill
link : https://groups.google.com/forum/#!topic/web2py/Ow-x1D4__q0 -- 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 because you

[web2py] Re: A DAL mssql question. Connection with FreeTDS and Unicode data in a Unicode-only collation problem

2014-02-14 Thread Niphlod
I'm planning to include another tds pure python driver that **seems** to avoid all this freetds ugliness, but the adapter library is a tad bit experimental. keeps fingers crossed a little bit more. On Friday, February 14, 2014 4:38:32 PM UTC+1, Falk wrote: Hi, After some frenzied trying

[web2py] Re: manage scheduler result with smartgrid

2014-02-14 Thread Niphlod
strange. I'm not a fan of smartgrid but could you try to include in fields also scheduler_task.id ? On Friday, February 14, 2014 1:33:36 PM UTC+1, Manuele wrote: Il 14/02/14 12:13, Manuele Pesenti ha scritto: Hi! does anybody can tell me what's wrong in this controller? Ok.. thanks to

[web2py] Re: Learning Management System survey

2014-02-14 Thread Trevor Strauss
Any plans to wrap it up and sell it? Would love to take it to market. -- 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] del db.my_table[id] shortcut not working any more after enabling record versioning

2014-02-14 Thread Horst Horst
I have a controller function for record deletion which worked reliably for quite some time. Today I've added added auth.enable_record_versioning(db) to my model file for the first time (my tables had auth.signature fields already). Since then, I get type 'exceptions.SyntaxError' No

[web2py] Is there a way to use parameters on --run (-R) ?

2014-02-14 Thread Tito Garrido
Hi Folks, Just a simple test... an external script: $: cat tito.py import sys print sys.argv Then running with web2py: $ python web2py.py -S welcome -M -R tito.py param1 param2 web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version

[web2py] Re: Cannot access virtual fields within a IS_IN_DB format function?

2014-02-14 Thread Horst Horst
Unfortunately, row.translator.custom_name doesn't work either: type 'exceptions.AttributeError' 'Row' object has no attribute 'translator' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Javascript runs locally but not when deployed

2014-02-14 Thread NeoToren
Tried it. Does work locally - does NOT work when deployed... On Friday, February 14, 2014 12:21:13 PM UTC-5, Leonel Câmara wrote: It could, as browser would block it. Just change: script src=http://widgets.aapc.com/countdown/aapc_cdwidgetbox_220.js /script To: script

[web2py] Re: Escaping '%' percent character

2014-02-14 Thread NeoToren
If you need it for running a SQL query using the LIKE operator...the following worked for me: sqlstring = SELECT * FROM tableX WHERE fieldY LIKE '%+something[0]+%' On Wednesday, February 12, 2014 12:28:35 PM UTC-5, Alejandro Garza Gracia wrote: Hello, I've looked through the documentation

[web2py] Serving images uploaded with Field('file', 'upload') as static assets?

2014-02-14 Thread HittingSmoke
I'm building my first public facing app with web2py using the basic image blog example from the docs but I'm concerned about performance. I'd like to have an upload form so I can post images to a blog with basic captions. I don't need any security for viewing so I'd like to have them served

[web2py] web2py API document, and method return values

2014-02-14 Thread Kiran Subbaraman
Hello, I was looking at this specific method update_record, and found it to be useful. I would like to know what its return values are based on whether the update succeeded or failed. I realized that on success, the updated Row is returned. Not sure what happens if there is any sort of

Re: [web2py] Setting DAL less strict from a model

2014-02-14 Thread Rene Dohmen
I just tested it with Michele's proposed code: Created a 0_db.py with the following content: real_DAL = DAL def DAL(*args, **kwargs): kwargs['check_reserved'] = False kwargs['entity_quoting'] = True return real_DAL(*args, **kwargs) Cool: the https://github.com/acidjunk/web2py-pages is

[web2py] Re: New to Web2Py: Large Model

2014-02-14 Thread Rene Dohmen
You could use extract_mysql_models.py (in the web2py/scripts folder) On Wednesday, February 12, 2014 4:58:29 PM UTC+1, Juslin Guo wrote: Hi, I have an application in PHP with 500 over tables, what's the best way to managed them in Web2Py, without repeating model definitions nor loading

Re: [web2py] New to Web2Py: Large Model

2014-02-14 Thread Carlos Correia
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Em 12-02-2014 15:58, Juslin Guo escreveu: Hi, I have an application in PHP with 500 over tables, what's the best way to managed them in Web2Py, without repeating model definitions nor loading them all. Hi, You can follow this approach:

[web2py] Re: Custom Regisration Form

2014-02-14 Thread Massimo Di Pierro
Can you show us the controller? On Tuesday, 11 February 2014 18:46:15 UTC-6, DMK wrote: I extended the auth_user table with additional profile fields (e.g. phone number, alert preference, etc.) and I'm trying to customize the registration form so that it shows only the desired fields

[web2py] Re: A Select Tag Helper Code

2014-02-14 Thread Massimo Di Pierro
def select_tag(name, options): return SELECT(*[OPTION(key,_value=options[key]) for key in options],_name=name) On Tuesday, 11 February 2014 18:51:47 UTC-6, DMK wrote: I wasn't able to find a simple function that would help generate a SELECT tag given a set of options (I did see the

[web2py] Re: Can the SQLFORM.grid show column headers even with no records?

2014-02-14 Thread Massimo Di Pierro
No. but open a ticket, perhaps this should be an option. On Tuesday, 11 February 2014 21:34:02 UTC-6, A36_Marty wrote: If I open a grid with records and delete until none are left, the grid column headers are shown. However, if the grid is loaded with no matching records, no column

[web2py] Re: Treat Datetime field as Date?

2014-02-14 Thread Massimo Di Pierro
If it does not support it, I cannot think of a better way. On Wednesday, 12 February 2014 11:31:06 UTC-6, Tim Nyborg wrote: I'm connecting to an MSSQL 2005 db, which only has the Datetime format (Date was added in 2008). Is there a standard way to treat a Datetime as a Date in web2py for

[web2py] Re: auto.py converting mysql schema to web2py models?

2014-02-14 Thread Massimo Di Pierro
https://github.com/web2py/web2py/blob/master/scripts/extract_mysql_models.py On Thursday, 13 February 2014 07:11:36 UTC-6, Osman Kazdal wrote: Hello, I searched in group for a tool to convert mysql schema to web2py models. There is talk about an auto.py script but link to that script seems

[web2py] Re: iterating form.custom.widget and set _class attribute

2014-02-14 Thread Massimo Di Pierro
form.custom.widget[field] cannot be a str. Are you sure? On Thursday, 13 February 2014 07:19:39 UTC-6, Kök Eksi Bir wrote: As explained in the book I can modify a fields class by setting _class as follows: form.custom.widget.some_field['_class']=input-block-level however when I iterate

[web2py] queries from tables

2014-02-14 Thread 黄祥
hi, i wannna create report and have the queries from tables, the result is not expected. e.g. def product(): from_date = request.vars.from_date to_date = request.vars.to_date query_purchase = (db.purchase_header.purchase_date = from_date) (db.purchase_header.purchase_date = to_date)

[web2py] Re: New to Web2Py: Large Model

2014-02-14 Thread 黄祥
I have an application in PHP with 500 over tables did you already create the web2py models for your current database? i mean using the extract script. e.g. web2py\scripts\extract_mysql_models.py without repeating model definitions pardon me, don't know what do you mean about this, if you

[web2py] Re: logout error

2014-02-14 Thread Massimo Di Pierro
You should have both: @auth.requires_login() @auth.requires_permission(request.function) the latter implies the former On Friday, 14 February 2014 04:27:31 UTC-6, ajith c t wrote: Hi I updated web2py 2.5 to 2.8, now the login and logout seems to work but with a problem, the login page

[web2py] Re: ReCaptcha: type 'exceptions.SyntaxError' setting key 'login_catpcha' does not exist?

2014-02-14 Thread Massimo Di Pierro
auth.settings.login_catpcha = Recaptcha(request, public_key, private_key) should be auth.settings.login_captcha = Recaptcha(request, public_key, private_key) On Friday, 14 February 2014 11:31:57 UTC-6, User wrote: I want to add a captcha to my login form. Eventually I want this to be

[web2py] Re: del db.my_table[id] shortcut not working any more after enabling record versioning

2014-02-14 Thread Massimo Di Pierro
del table[id] is more picky. Raises an exception if id is not int and if the record does not exist. On Friday, 14 February 2014 16:23:04 UTC-6, Horst Horst wrote: I have a controller function for record deletion which worked reliably for quite some time. Today I've added added

[web2py] Re: Is there a way to use parameters on --run (-R) ?

2014-02-14 Thread Massimo Di Pierro
python web2py.py -S welcome -M -R tito.py -A param1 param2 On Friday, 14 February 2014 16:35:15 UTC-6, Tito Garrido wrote: Hi Folks, Just a simple test... an external script: $: cat tito.py import sys print sys.argv Then running with web2py: $ python web2py.py -S welcome -M -R tito.py

  1   2   >