[web2py] how to set js variable from session variable?

2012-09-05 Thread weheh
I imagine someone has asked this but couldn't find it from my searches. Anyway, I want to set a javascript variable to the current session variable at time of execution of the javascript, not at time when it's loaded. So I can't just do: script ... blah ... function() { if (

[web2py] Re: Code editor on the administrative interface

2012-09-05 Thread caps.i.sin
wow! a few hours after my e-mail, the isue is already fixed I'm new on Web2py and on this group but I'm really impressed by the reactivity. Thank you very much Massimo Le mardi 4 septembre 2012 22:53:07 UTC+2, Massimo Di Pierro a écrit : This is now fixed in trunk and I will post 2.0.7 later

[web2py] Re: web2py login and register forms as part of main page

2012-09-05 Thread Yebach
Thank you for your fast reply With main page function you mean I include them in my mainpage.py contorler? OR do I just do a check if user is logged in and show the proper one if he is? thanx again On Tuesday, September 4, 2012 4:30:48 PM UTC+2, Anthony wrote: auth.login() and

[web2py] Re: Current status of adapting OrientDB for web2py

2012-09-05 Thread luckysmack
I am curious if anyone has made any advancements with OrientDB. I only recently found out about it and Neo4j. I had been planning on using mongo/couch for my db backend, but based on the way the graph databases are made, it could be of great use. @TheSweetlink iv'e also noticed that your

Re: [web2py] XML Webservice

2012-09-05 Thread hasan alnator
Dear Derek , What should i do then ?? Best Regards, On Wed, Sep 5, 2012 at 2:01 AM, Derek sp1d...@gmail.com wrote: It is XML, but it doesn't have a doctype. So, when it gets to this character: *’* it fails to validate against UTF-8. It should probably be this: charset=ISO-8859-1 On

Re: [web2py] Re: Bootstrap and custom forms and widgets

2012-09-05 Thread Alec Taylor
Thanks, set it to this and it's now working: .form-actions { background-color: #d9edf7; border-top: 0; padding: 0; } On Wed, Sep 5, 2012 at 3:58 AM, Anthony abasta...@gmail.com wrote: I don't think it's a bug. The submit button is in a div with class form-actions, and

[web2py] CentOS Web2py IOError - Permission denied

2012-09-05 Thread webtest
I am running web2py on Centos and used the fedora shell script to do the installation. It did set all my folder/files as apache:apache, did the selinux configuration and such. I have the welcome and examples applications loaded. When I run the examples application locally I get no errors (here

[web2py] Re: web2py login and register forms as part of main page

2012-09-05 Thread Anthony
On Wednesday, September 5, 2012 2:46:49 AM UTC-4, Yebach wrote: Thank you for your fast reply With main page function you mean I include them in my mainpage.py contorler? It depends exactly where you want the forms. If on every page, then you need to define in a model and include in the

[web2py] I can't display a thumbnail?

2012-09-05 Thread BlueShadow
Hi, its driving me nuts. I used the code from web2pyslices to generate thumbnails: db.py: db.define_table('Images', Field('Name',length=512), Field('Image','upload'), Field('thumb','upload',writable=False,readable=False), format = '%(Name)s' # important )

[web2py] web2py login redirect

2012-09-05 Thread Yebach
Hello My login function doesn't work. After I try to login i am redirected to user/user/profile instead back to my main page /school/index.html Register works, everything Also, if I login and enter the url where I should be redirected again I am redirected to /user/user/profile any

[web2py] Re: web2py 2.0.2 is out

2012-09-05 Thread pradeep cs
Hi, Is there any problem with windows binaries for XP, i tried installing the new version 2.0.7 on XP it is not working *C:\web2py1\web2pyweb2py.exe* *The system cannot execute the specified program.* regards Pradeep On Thursday, August 30, 2012 9:11:34 AM UTC+5:30, Massimo Di Pierro wrote:

[web2py] Re: web2py login redirect

2012-09-05 Thread Anthony
First suggestion -- post your code. :-) On Wednesday, September 5, 2012 8:15:40 AM UTC-4, Yebach wrote: Hello My login function doesn't work. After I try to login i am redirected to user/user/profile instead back to my main page /school/index.html Register works, everything Also, if I

[web2py] Re: web2py login redirect

2012-09-05 Thread Yebach
my view user.html div class=web2py_user_form id=web2py_user_form h2{{=T( request.args(0).replace('_',' ').capitalize() )}}/h2 {{=form}} {{if request.args(0)=='login':}} {{if not 'register' in auth.settings.actions_disabled:}} div class=flash_1 id=flash_1{{=response.flash or ''}}/div br / a

Re: [web2py] jQuery UI in 2.0.7

2012-09-05 Thread Richard Vézina
I had some problem with jQuery UI too, most were gone by using 1.8.16 ship with web2py (uncomment line in the layout that point to google api). Richard On Wed, Sep 5, 2012 at 1:35 AM, Annet anneve...@googlemail.com wrote: I just upgraded to 2.0.7, this backward comaptibility issue still hasn't

[web2py] web2py.js error

2012-09-05 Thread Johann Spies
Using Version 2.0.7 (2012-09-04 18:33:19) stable: I get this error on the Firebug console: Timestamp: 05/09/2012 15:22:54 Error: TypeError: doc.on is not a function Source File: http://localhost:8000/init/static/js/web2py.js Line: 42 The code: function web2py_event_handlers() { var doc =

Re: [web2py] CentOS Web2py IOError - Permission denied

2012-09-05 Thread Jonathan Lundell
On 4 Sep 2012, at 9:22 PM, webtest ert...@gmail.com wrote: I am running web2py on Centos and used the fedora shell script to do the installation. It did set all my folder/files as apache:apache, did the selinux configuration and such. I have the welcome and examples applications loaded.

[web2py] Re: web2py.js error

2012-09-05 Thread Anthony
Are you using a version of jQuery earlier than 1.7? On Wednesday, September 5, 2012 9:27:02 AM UTC-4, Johann Spies wrote: Using Version 2.0.7 (2012-09-04 18:33:19) stable: I get this error on the Firebug console: Timestamp: 05/09/2012 15:22:54 Error: TypeError: doc.on is not a function

[web2py] Re: web2py login redirect

2012-09-05 Thread Anthony
Looks like it's going to auth.settings.logged_url, which should only happen if you call the auth.register() function when the user is already logged in -- is that happening anywhere? Also, by default, if you get to the login page via the navbar link from another page, you will be redirected

Re: [web2py] Re: web2py.js error

2012-09-05 Thread Johann Spies
On 5 September 2012 15:44, Anthony abasta...@gmail.com wrote: Are you using a version of jQuery earlier than 1.7? Yes, I was trying to use jQuery-multiSelect which uses 1.6.4. Removing the following lines from my view: {{ # response.files.append(

[web2py] Re: Limit Length column

2012-09-05 Thread Mandar Vaze
Using maxtextlengths optional parameter partially helps. http://web2py.com/books/default/chapter/29/07?search=maxtextlengths I say partially because this param controls how many characters are displayed in the column (Only those many characters are sent by the server) If one has too many wide

[web2py] Re: I can't display a thumbnail?

2012-09-05 Thread villas
def Article(): id=request.vars.id row=db(db.Article.id==id).select() Not sure how you get the Images filenames. The code does not seem join the Article to the Image? Maybe something like: def Article(): id=request.vars.id # -- only ok for testing

Re: [web2py] compute fields do not show up in SQLFORM view form

2012-09-05 Thread Alan Etkin
Does NOT seem to work. computed field is still not visible. Same problem with this version: 2.0.7 (2012-09-04 18:33:19) stable (updated with hg) I think we should open an issue in the google code page. --

[web2py] Re: web2py 2.0.2 is out

2012-09-05 Thread Massimo Di Pierro
Looks like it is a DLL issue. Some DLLs are missing. I will try rebuild it today but I am not sure which one is missing. Has anybody successfully used the windows version 2.0.x? Massimo On Wednesday, 5 September 2012 07:29:51 UTC-5, pradeep cs wrote: Hi, Is there any problem with windows

Re: [web2py] Re: web2py.js error

2012-09-05 Thread Richard Vézina
For me chosen has keep working properly... Richard On Wed, Sep 5, 2012 at 10:06 AM, Johann Spies johann.sp...@gmail.comwrote: On 5 September 2012 15:44, Anthony abasta...@gmail.com wrote: Are you using a version of jQuery earlier than 1.7? Yes, I was trying to use jQuery-multiSelect which

[web2py] Re: I can't display a thumbnail?

2012-09-05 Thread BlueShadow
the image filename is joined to articles by this line: Field('TopImage',db.Images) id=request.vars.id #-- only ok for testing I removed some code to make it as short as possible the original version gets the article id from request.vars.id if none is given it redirects to a page where you can

[web2py] Re: Limit Length column

2012-09-05 Thread Anthony
If you want to control the column widths and allow the content to wrap if necessary, you can do so with CSS (and some JS in IE). Let's say you want to set the width of the 5th column. To support IE, in Javascript do: script $(function() { $('.ie .web2py_table

[web2py] Re: I can't display a thumbnail?

2012-09-05 Thread Anthony
On Wednesday, September 5, 2012 10:07:29 AM UTC-4, villas wrote: def Article(): id=request.vars.id row=db(db.Article.id==id).select() Not sure how you get the Images filenames. The code does not seem join the Article to the Image? Note, Article.TopImage.thumb does a recursive

Re: [web2py] Re: 2.02 Table name in smartgrid changed...

2012-09-05 Thread Adnan Smajlovic
Massimo, Any chance to leave only table_plural on line 2248 in sqlhtml.py: #header = table._plural + (field and ' for '+field.name or '') header = table._plural I would also leave all in one line if possible, e.g: table_level_1 id table_level_2, etc... Thanks, Adnan

Re: [web2py] Updated cheatsheet

2012-09-05 Thread rif
Maybe the otherwise param should appear in the cheatsheet: @auth.requires_login(otherwise=URL(...)) --

[web2py] Re: I can't display a thumbnail?

2012-09-05 Thread Anthony
thumbName='uploads.thumb.%s.jpg' % (uuid.uuid4()) im.save(request.folder + 'uploads/' + thumbName,'jpeg') The above is not quite the naming scheme expected by response.download. Instead of trying to make the name yourself, it might be easier to use the field's .store() method to

[web2py] Question about vars and crud.create (newbie)

2012-09-05 Thread tommasot
I need to catch the request parameters in a crud.create operation Thi the simple code in the controller form = crud.create(db.anno,next='list_anno') and this the domain db.define_table('anno', Field('descrizione'), Field('incorso','boolean'),format='%(descrizione)s') Now i want

[web2py] Re: Init Script in Web2Py

2012-09-05 Thread tommasot
Thank you so much Il giorno venerdì 10 agosto 2012 11:56:15 UTC+2, tommasot ha scritto: I have a newbie question. I need to create some record in db on application startup,like for example default user and other things.. Where is the right script/place to implement it --

[web2py] NewBie Question about crud.create

2012-09-05 Thread tommasot
I have the following code in the controller about record creation *form = crud.create(db.anno,next='list_anno')* This is the model,how you can see is very simple :) *db.define_table('anno', Field('descrizione'), Field('incorso','boolean'),format='%(descrizione)s')* Now i want to catch

Re: [web2py] Question about vars and crud.create (newbie)

2012-09-05 Thread Richard Vézina
What you want to do with the field? there is : db.tablename.fieldname.* = * Richard On Wed, Sep 5, 2012 at 10:50 AM, tommasot tommt...@gmail.com wrote: I need to catch the request parameters in a crud.create operation Thi the simple code in the controller form =

Re: [web2py] NewBie Question about crud.create

2012-09-05 Thread Richard Vézina
What you want to do exactly? Base on the value you are talking about filtering a dropbox list for an other field? If so there is lazy option plugin : http://dev.s-cubism.com/plugin_lazy_options_widget You will need to be more specific in your question if you want us to help you properly.

[web2py] Start web2py as windows service with ssl

2012-09-05 Thread Geo
Greetings, I have searched similar posts but I still can't make it work. I have a test machine with the following configuration: - Windows Server 2008 R2 Standard 64 - python 2.7 - pywin32_system32 - OpenSSL - web2py source 1.99.7 (2012-03-04 22:12:08) stable options.py: import socket

Re: [web2py] compute fields do not show up in SQLFORM view form

2012-09-05 Thread Massimo Di Pierro
yes please. Did this work in 1.99.7? On Wednesday, 5 September 2012 09:07:41 UTC-5, Alan Etkin wrote: Does NOT seem to work. computed field is still not visible. Same problem with this version: 2.0.7 (2012-09-04 18:33:19) stable (updated with hg) I think we should open an issue in the

Re: [web2py] Re: 2.02 Table name in smartgrid changed...

2012-09-05 Thread Massimo Di Pierro
Open an issue. We can make that a parameter. On Wednesday, 5 September 2012 09:49:11 UTC-5, Adi wrote: Massimo, Any chance to leave only table_plural on line 2248 in sqlhtml.py: #header = table._plural + (field and ' for '+field.name or '') header = table._plural

Re: [web2py] Updated cheatsheet

2012-09-05 Thread Massimo Di Pierro
It should On Wednesday, 5 September 2012 09:57:30 UTC-5, rif wrote: Maybe the otherwise param should appear in the cheatsheet: @auth.requires_login(otherwise=URL(...)) --

Re: [web2py] Re: web2py.js error

2012-09-05 Thread Johann Spies
On 5 September 2012 16:10, Richard Vézina ml.richard.vez...@gmail.comwrote: For me chosen has keep working properly.. What is 'chosen' in this context? I have used the native web2py widget in the past - that stopped working in the past few weeks with changes to the trunk. I have also used

Re: [web2py] little css issue and french translation

2012-09-05 Thread Calycé
Hi Richard, The french translation would be better as: Propulsé par and not Propulser par. BTW, nice to see french speaking folks around here ;-) On Wednesday, September 5, 2012 4:31:10 PM UTC+2, Richard wrote: Hello, I found that if the number of menu entries are to high or if the text

Re: [web2py] Updated cheatsheet

2012-09-05 Thread rif
Also the cast parameter. Are the sources for the cheatsheet available so we can make patch suggestions? -rif miercuri, 5 septembrie 2012, 18:53:45 UTC+3, Massimo Di Pierro a scris: It should On Wednesday, 5 September 2012 09:57:30 UTC-5, rif wrote: Maybe the otherwise param should appear

Re: [web2py] jQuery UI in 2.0.7

2012-09-05 Thread Annet
Hi Richard, Thanks for you reply. I had some problem with jQuery UI too, most were gone by using 1.8.16 ship with web2py (uncomment line in the layout that point to google api). That version introduced another problem, the auto complete's list wasn't displayed properly, besides, it didn't

Re: [web2py] Re: web2py.js error

2012-09-05 Thread Anthony
On Wednesday, September 5, 2012 11:57:23 AM UTC-4, Johann Spies wrote: On 5 September 2012 16:10, Richard Vézina ml.richa...@gmail.comjavascript: wrote: For me chosen has keep working properly.. What is 'chosen' in this context? Probably http://harvesthq.github.com/chosen/. I have

[web2py] DB Migration (sqlite-pgsql) Problems with 1.99.7 - 2.0.6 - 2.0.7 Versions

2012-09-05 Thread Christian Espinoza
Hello, I'm in trouble with a webapp that I'have. I develop it using sqlite only for a best approach of web2py features with it. And I'm trying to migrate it to a Postgresql DB to put it on Testing phase. But It doesn't work with PostgreSQL, only work with sqlite, I'd tried with 1.99.7 -

[web2py] Re: NewBie Question about crud.create

2012-09-05 Thread Anthony
Do you want to manipulate it (a) after submission but before validation (use request.vars.incorso), (b) after validation but before the insert (use crud.settings.create_onvalidation), or (c) after the record is inserted (use crud.settings.create_onaccept). Anthony On Wednesday, September 5,

[web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Yarin
Is this documented anywhere? --

Re: [web2py] jQuery UI in 2.0.7

2012-09-05 Thread Richard Vézina
Ok, I may have to take a look at 2.0.7 thought! Richard On Wed, Sep 5, 2012 at 12:23 PM, Annet anneve...@googlemail.com wrote: Hi Richard, Thanks for you reply. I had some problem with jQuery UI too, most were gone by using 1.8.16 ship with web2py (uncomment line in the layout that point

Re: [web2py] little css issue and french translation

2012-09-05 Thread Richard Vézina
You right, I realised it after I sent my email :( Richard On Wed, Sep 5, 2012 at 11:58 AM, Calycé welcome.to.dev.n...@gmail.comwrote: Hi Richard, The french translation would be better as: Propulsé par and not Propulser par. BTW, nice to see french speaking folks around here ;-) On

[web2py] Re: 2.02 Table name in smartgrid changed...

2012-09-05 Thread Paolo Caruccio
to display all breadcrumbs in the same line please try to append to web2py.css following rule li.w2p_grid_breadcrumb_elem { display:inline-block; } in versions = 2.0.2 web2py.css file has the right rule, so this issue should arise only with previous experimental versions. Il giorno

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Bruno Rocha
db(db.table.field == None).select() should give you all records with field = NULL db(~db.table.field == None).select() All records where field NULL Is that? --

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Marin Pranjić
it is db.table.field != None operator ~ is used for ORDER BY and it maps to DESC. On Wed, Sep 5, 2012 at 7:59 PM, Bruno Rocha rochacbr...@gmail.com wrote: db(~db.table.field == None).select() --

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Bruno Rocha
On Wed, Sep 5, 2012 at 3:12 PM, Marin Pranjić marin.pran...@gmail.comwrote: it is db.table.field != None operator ~ is used for ORDER BY and it maps to DESC. Yes, my bad, you are right, but there is one case where ~ is used in query ~db.table.field.belongs(list) and

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Yarin
Thanks. Massimo we need this in the docs. On Wednesday, September 5, 2012 2:38:26 PM UTC-4, rochacbruno wrote: On Wed, Sep 5, 2012 at 3:12 PM, Marin Pranjić marin@gmail.comjavascript: wrote: it is db.table.field != None operator ~ is used for ORDER BY and it maps to DESC. Yes, my

[web2py] Accessing id in SQLFORM.process()

2012-09-05 Thread Philip Kilner
Hi, I'm trying to wean myself of CRUD and am doing an insert with SQLFORM.process(). I want to redirect on success to view the newly inserted record. How can I access the ID of the new record in this context? Hoped I could do something like: -

[web2py] Re: Start web2py as windows service with ssl

2012-09-05 Thread Niphlod
a little bug I found (and corrected) is that if you comment out ssl_certificate and ssl_private_key, that parameter is missing, and web2py requires it. If you don't need certificates just set ssl_certificate and ssl_private_key to None (as current trunk options_std.py

[web2py] Re: Accessing id in SQLFORM.process()

2012-09-05 Thread Niphlod
in any case it should be at least form.vars.id. Don't know if it's available inside the process() environment. Even if it doesn't work, is it so hard to if form.process().validate: redirect(URL('whatever', args=form.vars.id)) ? On Wednesday, September 5, 2012 8:41:44 PM UTC+2, Philip

Re: [web2py] Re: Accessing id in SQLFORM.process()

2012-09-05 Thread Marin Pranjić
Should be accepted instead of validate: form = SQLFORM(...).process() if form.accepted: ... redirect(URL(..., args=form.vars.id)) On Wed, Sep 5, 2012 at 8:56 PM, Niphlod niph...@gmail.com wrote: in any case it should be at least form.vars.id. Don't know if it's available inside the process()

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Marin Pranjić
Thanks, good to know :) On Wed, Sep 5, 2012 at 8:37 PM, Bruno Rocha rochacbr...@gmail.com wrote: On Wed, Sep 5, 2012 at 3:12 PM, Marin Pranjić marin.pran...@gmail.comwrote: it is db.table.field != None operator ~ is used for ORDER BY and it maps to DESC. Yes, my bad, you are right, but

Re: [web2py] Re: Accessing id in SQLFORM.process()

2012-09-05 Thread Niphlod
whoops, right: form = SQLFORM(db.table) if form.process().accepted: redirect(URL('whatever', args=form.vars.id)) On Wednesday, September 5, 2012 9:00:10 PM UTC+2, Marin Pranjić wrote: Should be accepted instead of validate: form = SQLFORM(...).process() if form.accepted: ...

Re: [web2py] Re: 2.02 Table name in smartgrid changed...

2012-09-05 Thread Adnan Smajlovic
thanks Paolo... worked perfectly. On Wed, Sep 5, 2012 at 1:59 PM, Paolo Caruccio paolo.carucci...@gmail.comwrote: to display all breadcrumbs in the same line please try to append to web2py.css following rule li.w2p_grid_breadcrumb_elem { display:inline-block; } in versions = 2.0.2

Re: [web2py] how to set js variable from session variable?

2012-09-05 Thread Marin Pranjić
jQuery.get('CALLBACK_URL', function(data){ alert(data); }); source: http://api.jquery.com/jQuery.get/ On Wed, Sep 5, 2012 at 8:15 AM, weheh richard_gor...@verizon.net wrote: I tried an ajax call to a controller callback, that in turn returns $('#myjsvar').val('%d'); % session.myvar, based

Re: [web2py] how to set js variable from session variable?

2012-09-05 Thread Marin Pranjić
On Wed, Sep 5, 2012 at 10:00 PM, Marin Pranjić marin.pran...@gmail.comwrote: jQuery.get('CALLBACK_URL', function(data){ alert(data); }); source: http://api.jquery.com/jQuery.get/ On Wed, Sep 5, 2012 at 8:15 AM, weheh richard_gor...@verizon.net wrote: I tried an ajax call to a

Re: [web2py] required option in Field

2012-09-05 Thread Marin Pranjić
This should work for other field types as you expect, but empty string is still valid string value. You can set: requires=IS_LENGTH(minsize=1) to disallow empty strings. On Tue, Sep 4, 2012 at 7:24 PM, Denis Rykov ryk...@gmail.com wrote: I use the following Field definition:

[web2py] 2.0.6: Required=True not enforced by DAL?

2012-09-05 Thread mjm
I have created simple table: db.define_table('hoortoestel', # algemeen Field('merk', type='string', required=True, ), Field('type', type='string', required=True, ), ... When trying to enter a new record in appadmin I noticed that when not entering anything in either field, the new record data

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Marin Pranjić
Db.table.field == None On Sep 5, 2012 6:42 PM, Yarin ykess...@gmail.com wrote: Is this documented anywhere? -- --

[web2py] 2.0.6 bug? required=True not enforced

2012-09-05 Thread mjm
I have defined a simple table: db.define_table('hoortoestel', # algemeen Field('merk', type='string', required=True, ), Field('type', type='string', required=True, ), ... If I then try to enter a new record in appadmin and do not enter anything for the fields, the record is still accepted

[web2py] Connecting to external databases

2012-09-05 Thread Gregg Branquinho
I am building a json webservice in web2py and it is being used by many different frontends.. What I am looking to do on the back end is connected to external databases (1 postgre, 2 mssql) and return the correlated data from the different servers to the json client. What I am struggling with

Re: [web2py] required option in Field

2012-09-05 Thread Niphlod
IS_NOT_EMPTY() is more remembereable . @Marin: when you reply from your mail client please strip the re: from the subject or in the group it will show as a separate thread. On Wednesday, September 5, 2012 10:07:11 PM UTC+2, Marin Pranjić wrote: This should work for other field types as you

[web2py] Re: 2.0.6 bug? required=True not enforced

2012-09-05 Thread Niphlod
As steted on the book Notice that requires=... is enforced at the level of forms, required=Trueis enforced at the level of the DAL (insert), while notnull, unique and ondelete are enforced at the level of the database. While they sometimes may seem redundant, it is important to maintain the

Re: [web2py] 2.0.6 bug? required=True not enforced

2012-09-05 Thread Marin Pranjić
I would expect that both constraints are accepted (empty string is not Null). Is the behavior different from older versions? On Wed, Sep 5, 2012 at 7:39 PM, mjm mjm...@webtothemax.com wrote: I have defined a simple table: db.define_table('hoortoestel', # algemeen Field('merk',

Re: [web2py] Re: 2.02 Table name in smartgrid changed...

2012-09-05 Thread Paolo Caruccio
Moreover, if you are interested (I don't know if this is documented), you could change breadcrumbs divider and assign a css class to breadcrumbs itself. The complete signature for the smartgrid is indeed the following: SQLFORM.smartgrid( table, constraints=None,

[web2py] Re: Connecting to external databases

2012-09-05 Thread Niphlod
if you want to use the dal to retrieve data from your databases you should connect to them. dbmysql = DAL('mysql://...') dbmmsql = DAL('mssql://...') What is your issue ? On Wednesday, September 5, 2012 6:18:23 PM UTC+2, Gregg Branquinho wrote: I am building a json webservice in web2py and

Re: [web2py] required option in Field

2012-09-05 Thread Marin Pranjić
I don't know why this happens - I always reply from email and it is always in the same thread. Sorry about that. Dana srijeda, 5. rujna 2012. 22:14:09 UTC+2, korisnik Niphlod napisao je: IS_NOT_EMPTY() is more remembereable . @Marin: when you reply from your mail client please strip the re:

Re: [web2py] XML Webservice

2012-09-05 Thread Derek
Create a template with xmlservice.xml and add the appropriate fields. On Wednesday, September 5, 2012 12:50:28 AM UTC-7, Hassan Alnatour wrote: Dear Derek , What should i do then ?? Best Regards, On Wed, Sep 5, 2012 at 2:01 AM, Derek sp1...@gmail.com javascript:wrote: It is XML, but

[web2py] Re: Accessing id in SQLFORM.process()

2012-09-05 Thread Anthony
Try: SQLFORM(db.t_account).process(next=URL('account', 'index', args='t_account') + '/[id]') If you put the variable name in brackets, it (plus the brackets) should get replaced with the variable's value. Also, .process (and .validate) take an onsuccess argument, which can be a callable:

Re: [web2py] Updated cheatsheet

2012-09-05 Thread Massimo Di Pierro
I will add the source to the web2py repo. On Wednesday, 5 September 2012 11:04:02 UTC-5, rif wrote: Also the cast parameter. Are the sources for the cheatsheet available so we can make patch suggestions? -rif miercuri, 5 septembrie 2012, 18:53:45 UTC+3, Massimo Di Pierro a scris: It

[web2py] Re: DB Migration (sqlite-pgsql) Problems with 1.99.7 - 2.0.6 - 2.0.7 Versions

2012-09-05 Thread Massimo Di Pierro
Did you install psycopg2? If not it is probably using pg8000. Can you please help us debug? Edit dal.py and in the function log_excecute can you print the value of the command variable? What does it print when it fails? On Wednesday, 5 September 2012 11:29:42 UTC-5, Christian Espinoza wrote:

[web2py] Re: 2.0.6: Required=True not enforced by DAL?

2012-09-05 Thread Massimo Di Pierro
required=True means that a value must be provided. For a string merk='' is a value. On Wednesday, 5 September 2012 12:27:05 UTC-5, mjm wrote: I have created simple table: db.define_table('hoortoestel', # algemeen Field('merk', type='string', required=True, ), Field('type',

Re: [web2py] 2.0.6 bug? required=True not enforced

2012-09-05 Thread Massimo Di Pierro
No. This was always like this. On Wednesday, 5 September 2012 15:18:05 UTC-5, Marin Pranjić wrote: I would expect that both constraints are accepted (empty string is not Null). Is the behavior different from older versions? On Wed, Sep 5, 2012 at 7:39 PM, mjm mjm...@webtothemax.com

[web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread PlanetUnknown
Trying to make a simple ajax call from the view back to the controller. It is working, however the data I'm sending isn't coming in the request.vars if I sent the contentType=application/json. I know there is an internal ajax function, but I have my own library with these functions I'd like to

Re: [web2py] CentOS Web2py IOError - Permission denied

2012-09-05 Thread webtest
Yes you are right! disabling it fixed the problem. Can you also please point me to a direction where I can learn how to set up multiple applications running at the same time with no selinux permission issues? Thanks a lot again for the quick response. On Wednesday, September 5, 2012 8:40:02 AM

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Bruno Rocha
Your URL should have the vars url: /test01/default/getContent?sourcetitle=xxx If you do not pass the vars on url you can't get them at the called controller --

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Nik
Thanks Bruno ! That worked, but now when I get the response back as JSON, JQuery throws an error saying the JSON isn't valid. The JSON seems valid to me also passes JSONLint test : {readyState:4,responseText:FIFA support India for U-17 and 2022 World Cup - Times,status:200,statusText:OK}

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Bruno Rocha
or you call it with .json extension and use the generic json view url: /test01/default/getContent*.json*?sourceTitle=x or you do this on the return import json def getContent(): titleArg = str(request.vars.sourceTitle) print -- print

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Nik
That worked too ! You rock :) On Wednesday, 5 September 2012 17:58:16 UTC-4, rochacbruno wrote: or you call it with .json extension and use the generic json view url: /test01/default/getContent*.json*?sourceTitle=x or you do this on the return import json def getContent(): titleArg

Re: [web2py] Re: DB Migration (sqlite-pgsql) Problems with 1.99.7 - 2.0.6 - 2.0.7 Versions

2012-09-05 Thread Christian Espinoza
Hi Massimo, this is: *File /opt/web-apps/web2py/gluon/dal.py in log_execute at line 1653* Code listing 1648. 1649. 1650. 1651. 1652. 1653. 1654. 1655. 1656. 1657. command = a[0] if self.db._debug: logger.debug('SQL: %s' % command) self.db._lastsql = command

[web2py] sqlform.grid and query conditions

2012-09-05 Thread Kevin C
Basically, we are generating a SQLFORM.grid with the following code: db.pages.stores_id.default = STORE_DETAILS.id query = ((db.pages.stores_id == STORE_DETAILS.id)) form = SQLFORM.grid(query=query) return dict(form=form) This is working perfectly fine for us. However, we have

Re: [web2py] sqlform.grid and query conditions

2012-09-05 Thread Bruno Rocha
You can do: if request.args(0) in ['edit', 'delete']: STORE_DETAILS.id == int(request.args(2)) or redirect(URL('default', 'wherever')) db.pages.stores_id.default = STORE_DETAILS.id query = ((db.pages.stores_id == STORE_DETAILS.id)) form = SQLFORM.grid(query=query)

Re: [web2py] sqlform.grid and query conditions

2012-09-05 Thread Kevin Cackler
We did something similar but it feels very hackish, considering it has to be done in every method of the admin controller. I just wanted to see if there was a better way. Thank you. Kevin Cackler Tech Daddies 501-205-1512 http://www.techdaddies.com On 9/5/2012 7:45 PM, Bruno Rocha wrote:

Re: [web2py] compute fields do not show up in SQLFORM view form

2012-09-05 Thread Alan Etkin
El miércoles, 5 de septiembre de 2012 12:51:06 UTC-3, Massimo Di Pierro escribió: yes please. Did this work in 1.99.7? Ok, the current way is the same as in 1.99.7. SQLFORM output hides by default computed fields. The problem was discussed in this threads before:

[web2py] Re: Updated cheatsheet

2012-09-05 Thread Cliff Kachinske
Bless you for this. It helps so much with my advanced case of CRS. On Tuesday, September 4, 2012 11:12:03 AM UTC-4, Massimo Di Pierro wrote: http://web2py.com/examples/static/web2py_cheatsheet.pdf --

[web2py] Override auth.login()?

2012-09-05 Thread Alec Taylor
I want to override the default auth.login(), so wherever auth.login is called my customised login form appears. Here are the customisations I've made to it in my view [which works]: for label in form.elements('label'): if label[-1]!='Remember me (for 30 days)': label[_style] =

Re: [web2py] XML Webservice

2012-09-05 Thread hasan alnator
Dear derek, This is my first time useing web service .. Can you please give me a simple example of what you are talking about .. How to creat a template .. And how fo add fields .. Thank you a lot. On Sep 5, 2012 11:21 PM, Derek sp1d...@gmail.com wrote: Create a template with xmlservice.xml

[web2py] Why would I use DIV classes/helpers, over an html template?

2012-09-05 Thread luckysmack
Traditionally, for html templates, I would do something like this in a template.php file (i am coming from php): *div* *Hello ?= $name ?* */div* and reading through the docs for web2py, I see the classes like DIV(), which i can then add id's, classes, and other attributes to, to be

Re: [web2py] Re: Limit Length column

2012-09-05 Thread Mandar Vaze / मंदार वझे
Anthony, I guess the following will apply to ALL the sqlform.grid in the app, correct ? Generally, we have multiple different sqlform.grid across the app, and each instance may have different columns (and thus possible needing different column widths) I am looking for something like