Re: [web2py] Using GAE Launcher - a beginner's question

2012-09-13 Thread Massimo Di Pierro
admin is readonly on GAE. GAE has a readonly file system. You have to create apps locally and then deploy them. On Thursday, 13 September 2012 21:10:18 UTC-5, Igor Rafael wrote: > > I'm using the web2py 2.0.8 and had the same problem. > The suggested workaround worked. > > However when I try to

[web2py] Loop on form.process(). Validation is not done

2012-09-13 Thread Luis Furtado
Hello, When I submit the form no validation errors are shown and, after a few seconds, it just shows the form again, totally blank even if I had filled some fields. If I include @auth.requires_login() at index() it even gets back to login instead of the form. It seems as if the application is re

Re: [web2py] Using GAE Launcher - a beginner's question

2012-09-13 Thread Igor Rafael
I'm using the web2py 2.0.8 and had the same problem. The suggested workaround worked. However when I try to create a new app through the admin interface I get the following message: unable to create application "test"Traceback (most recent call last): File "/opt/web2pytests/gluon/admin.py", li

[web2py] Re: Problem accessing Rows/Row

2012-09-13 Thread MichaelF
The problem is that I need to change the problem line from: 246:if attch.Addl_info_item.Email_text: to: 246:if attch.Email_text: My previous 'select' statements retrieved fields from several tables, while this one (the 'problem' one) retrieves from only one table. So, if I understand co

[web2py] web2py 2.0.9 is out

2012-09-13 Thread Massimo Di Pierro
It fixes a few minor issues and bugs. The most notable features are a better layout, and admin now ships only with the codemirror editor. It works better under windows. I strongly suggest you upgrade. There are still some open issues but they are not new of 2.0.9 - dropbox login does not work (

[web2py] Re: Installing Windows Service (2.0.9 Win exe)

2012-09-13 Thread Massimo Di Pierro
Can you please open a ticket about this? On Thursday, 13 September 2012 20:04:44 UTC-5, Andrew W wrote: > > Having troubles installing web2py as a windows service. I'm running 2.0.9 > windows exe.Note that I've never run it like this before until version > 2.0.x. > > File "gluon/winservice.

[web2py] Re: w2p 2.08 stable: invalid table or field name: 40off_sh

2012-09-13 Thread Massimo Di Pierro
Please open a ticket about this. For now it should safe for you to change the regex in the source. I assumed (incorrectly) that SQL did not allow table/field names starting with a number. Massimo On Thursday, 13 September 2012 19:58:48 UTC-5, Adi wrote: > > for the convenience i pulled out both

[web2py] Re: Howto? Host 2 or more applications in a single web2py folder to google app engine

2012-09-13 Thread Massimo Di Pierro
I would simply do db = DAL('google:datastore://' + request.application) and each application with get its own namespace. There is really nothing else to do. You use each of your app normally but they will coexist while using different data. I have not used this feature in some time so I hope r

Re: [web2py] Question about the necessity to have 2 auth_user tables in a web2py app.... ?

2012-09-13 Thread villas
It is trivial for one app to access the data of another. Simply make more than one connection: db = DAL() db2 = DAL(...) db1rows = db(db.auth_user.id > 0).select() db2rows = db2(db2.auth_user.id > 0).select() But you cannot do joins directly between the tables. You have to work around t

[web2py] Re: Problem accessing Rows/Row

2012-09-13 Thread villas
I don't really know, but I would suggest playing around with things on the commandline. python web2py.py -S yourapp -N -M >>> rows = db(db.Addl_info_item.id > 0).select() >>> for f in rows[0]: print f >>> for r in rows: print r.Email_text etc etc You can put more and more code in there and h

Re: [web2py] Question about the necessity to have 2 auth_user tables in a web2py app.... ?

2012-09-13 Thread Don_X
Villas ... Two apps ! - that was my previous thought when I started this whole adventure ! .. and I remember I asked questions in regards to 2 apps where one accesses the tables of the other for various purpose .. or simply sharing tables between two web2py apps ! ... I remember I ended up wal

[web2py] Installing Windows Service (2.0.9 Win exe)

2012-09-13 Thread Andrew W
Having troubles installing web2py as a windows service. I'm running 2.0.9 windows exe.Note that I've never run it like this before until version 2.0.x. File "gluon/winservice.py", line 157, in web2py_windows_service_handler WindowsError: [Error 267] The directory name is invalid : 'E:\\ ...

[web2py] Re: w2p 2.08 stable: invalid table or field name: 40off_sh

2012-09-13 Thread Adi
for the convenience i pulled out both versions, and my suggested change: 1.99.7 cleanup: def cleanup(text): """ validates that the given text is clean: only contains [0-9a-zA-Z_] """ if re.compile('[^0-9a-zA-Z_]').findall(text): raise SyntaxError, \ 'only [0-9a

[web2py] Re: HTTPS Admin Page Remote Connection

2012-09-13 Thread Andrew
If your app is proxied you might be running into an apache config issue. See the following: https://bugzilla.redhat.com/show_bug.cgi?id=843326 & https://github.com/rmillner/crankcase/commit/58f582172a43c118e8610b023853945dd01cc7ca The used the following to make sure the correct wsgi param is se

[web2py] w2p 2.08 stable: invalid table or field name: 40off_sh

2012-09-13 Thread Adi
One of my fields is 40off_sh (legacy MySQL db), and all works fine in 1.97. Seems like cleanup function in dal doesn't like the numeric part at the beginning of field name, or I'm reading it wrong? I checked the table and the field is in, so it's not missing. I can't change the field name, sin

[web2py] Re: Howto? Host 2 or more applications in a single web2py folder to google app engine

2012-09-13 Thread Pystar
So can I see some code on how to accomplish this in web2py? On Thursday, September 13, 2012 10:54:57 PM UTC+1, Massimo Di Pierro wrote: > > https://developers.google.com/appengine/docs/java/multitenancy/multitenancy > > you can specify a namespace in web2py with: > > db = DAL('google:datastore://'

[web2py] Re: Python for Android (any takers to run web2py)

2012-09-13 Thread luckysmack
Has anyone made any progress with this? I had a conversation with someone on irc.freenode #kivy . it seems like it could be possible to do. but maybe out of the scope of web2py? : * * would kivy work with something like web2py, which has dynamic module loading? * * or would

Re: [web2py] Many-many options

2012-09-13 Thread Derek
I'm all for 3NF but if you are making a postal address table and you want to split the states and cities out of the same table, even though they will almost always be used together, that's just dumb IMHO. You shouldn't have 3NF just for the sake of having it, you should use it if it makes sense.

Re: [web2py] short term roadmap

2012-09-13 Thread Andrew W
Great idea, allowing a core set of options, and add your own as well. I've been meaning to have a look at Martin's bootstrap app, it would fit into this approach - Having more than one valid option/approach. On Friday, September 14, 2012 8:43:27 AM UTC+12, rochacbruno wrote: > > also it will nee

Re: [web2py] Re: Bug? crud.settings.auth NOT set. Forces login and all crud urls yield insuficient priveleges message

2012-09-13 Thread Joe Codeswell
Dear Massimo, I just sent you a zip of the app. Thanks for the help. Love and peace, Joe On Thu, Sep 13, 2012 at 4:42 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Can you email me your app? Could be a bug in web2py but it will be easier > to check it with your app. > > Massimo

[web2py] Problem accessing Rows/Row

2012-09-13 Thread MichaelF
I do a similar set of steps, yet one of the sets acts differently. I'm trying to loop through a query return (Rows), but I'm obviously missing something basic. I do a query and 'print' the return. Here's a snippet from my controller: line 144: instAttch = db((db.Meet.id == request.args(1)) &

Re: [web2py] fake_migrate options works, but then problem when taken out

2012-09-13 Thread MichaelF
Nowhere else is [Ii]s_home_team referenced. I had to move on, so I deleted the table and recreated it. On Thursday, September 13, 2012 2:01:51 PM UTC-6, Marin Pranjić wrote: > > I don't think KeyError is related to migrations. I am not sure. > Can you give us error traceback? > > On Thu, Sep 13,

[web2py] Re: Howto? Host 2 or more applications in a single web2py folder to google app engine

2012-09-13 Thread Massimo Di Pierro
https://developers.google.com/appengine/docs/java/multitenancy/multitenancy you can specify a namespace in web2py with: db = DAL('google:datastore://') You can deploy multiple apps under the same GAE instance and one web2py as long as they use different namespaces. On Thursday, 13 September

Re: [web2py] Adding cancel button - form submission

2012-09-13 Thread Massimo Di Pierro
+1 On Thursday, 13 September 2012 12:17:17 UTC-5, Henrik Holm wrote: > > Has this "add_button" been added to one of the recent releases? I'm > running 1.99.7 and I get > > * 'SQLFORM' object has no attribute > 'add_button'* > > Maybe it's time to upgrade :-) > > Thanks, > Henrik > > > On Tue

[web2py] Re: HTTPS Remote Admin Page Access

2012-09-13 Thread Massimo Di Pierro
Can you try the full path to certificate files? Are you sure they work? Meanwhile you can run admin on port 127.0.0.1 and connect via ssl tunnel. On Thursday, 13 September 2012 09:54:18 UTC-5, Francisco Barretto wrote: > > Hi There, > > I'm trying to use web2py in a ubuntu server without graphi

Re: [web2py] [ANN] Started development on web2admin

2012-09-13 Thread Bruno Rocha
Nice work! the select2.js is the same as choosen? I really like it! should have a web2py widget for this. SUGGESTION: it is very annoying to request "host/app/plugin_web2admin" the url does not looks good. To change this, the hard option is tricking on routes. But there is an easy way: NOTE: it

[web2py] Re: web2py book on github

2012-09-13 Thread Yarin
@Massimo @Niphlod Patch for scheduler docs. Mostly clarifications and syntactical corrections. Thanks-. On Saturday, September 1, 2012 1:00:49 PM UTC-4, Massimo Di Pierro wrote: > > The web2py book app has been rewritten > >http://www.web2py.com/book > > and the source of the app and the bo

Re: [web2py] [ANN] Started development on web2admin

2012-09-13 Thread rif
New features: - Admin logo configuration - Actions (execute functions on multiple rows) - w2a_export permission for restricting export feature - Screenshots in readme :) - Tweaks and bug fixes More to come: - Table fields exclusion - Filters (easy restrict range of displ

Re: [web2py] Question about the necessity to have 2 auth_user tables in a web2py app.... ?

2012-09-13 Thread villas
I definitely agree with Richard. There is no easy way to have two auth systems in one app. From your description, I do not see why you cannot achieve what you wish with one login and giving users the membership of various groups. This is how auth was designed. However, you do have another

Re: [web2py] Question about the necessity to have 2 auth_user tables in a web2py app.... ?

2012-09-13 Thread Richard Vézina
You can't achieve what you want by using group? I mean you have an admin group the one that are in this group can acces your deeper feature strictly reserved... Like that you can always use web2py mechanism to verify if user is a member a given group. To me duplicate auth system is overkill and y

Re: [web2py] short term roadmap

2012-09-13 Thread Bruno Rocha
also it will need on admin BUTTON('update scaffold list') and in command line web2py.py -S updatescaffold --

Re: [web2py] short term roadmap

2012-09-13 Thread Bruno Rocha
I would like to have a repo of scaffold apps and a command line tool + /admin tool to checkout ADMIN -> create new app -> SELECT(*['simple', 'bootstrap', 'foundation', 'ecommerce', 'tuned',..long list]) and on command line >>>python web2py.py -S newappname*|*foundation >>> downloading 'f

[web2py] Question about the necessity to have 2 auth_user tables in a web2py app.... ?

2012-09-13 Thread Don_X
Hello folks ... There is a bit of similarity with another thread below regarding 2 auth_user tables ( for 2 different logins or authentification methods in the same app) ! but before I dive in the question I want to ask, I need to share a bit of the nature and the genesis of the project that I

Re: [web2py] short term roadmap

2012-09-13 Thread Michele Comitini
I think that welcome app should be changed to a very simple hello world type example. Then welcome app become a project on its own, with latest stable version always included in web2py distribution. Welcome app would have its roadmap and milestones in parallel to web2py but without strict synchroni

Re: [web2py] fake_migrate options works, but then problem when taken out

2012-09-13 Thread Marin Pranjić
I don't think KeyError is related to migrations. I am not sure. Can you give us error traceback? On Thu, Sep 13, 2012 at 7:20 PM, MichaelF wrote: > I don't know where the lower case is_home_team is coming from. In the > entire app dir it appears only in the error pages. > > The 'migrate = true,

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Massimo DiPierro
"Rows object, that cached (pickled) returns a list, but it's not "transformed back" to a full Rows object." this is because of legacy pickling code. We can fix it. On Sep 13, 2012, at 2:44 PM, Niphlod wrote: > doh. found! > maybe it's better to put it in the book. > > cacheable makes the selec

Re: [web2py] SOAP XML Return Objects

2012-09-13 Thread Fabio Lugo
Hello. I used this code to get the resultset of a select as xml def export_xml(rows): idx=range(len(rows.colnames)) colnames=[] for item in rows.colnames: colnames.append('column') datos=[] for row in rows.response :

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Niphlod
doh. found! maybe it's better to put it in the book. cacheable makes the select return a "stripped" Rows object. When you use cache, if cacheable is False, you store the list of the results, that are turned into a Rows object "filling" a new empty copy. So, cacheable=False cached results are the

Re: [web2py] Re: web2py default layout.html

2012-09-13 Thread Paolo Caruccio
I found the reason of this wrong behavior. The elements having class "row" inherit the width from "container", as you know, but they have a negative margin-left (-20px). The negative margin-left is balanced out with the margin-left of the elements having class "span*" (20px) In our case we had:

[web2py] Re: HTTPS Admin Page Remote Connection

2012-09-13 Thread dhmorgan
The method depends on which web server are you using. Which one are using? General guidance can be found in book, chapter 13 http://web2py.com/book/default/chapter/13 On Thursday, September 13, 2012 8:38:45 AM UTC-5, Francisco Barretto wrote: > > Hi There! > > Deploying web2py on a server

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Niphlod
no errors but both (cacheable and not cacheable) are gluon.dal.Rows before pickling and list after pickle.dumps() On Thursday, September 13, 2012 9:18:59 PM UTC+2, Massimo Di Pierro wrote: > > try pickle and unpickle this: > rows = db(db.tests.id>0).select(cache=(cache.disk, 200), cacheable=True)

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Bruno Rocha
Ok, changing all my selects to cacheable=False it works on .disk, redis and memcache. Even on the rows where I am not using the .find() and .exclude() methods the cache are failing. If do {{for row in cached_rows:}} {{pass}} it gives me nothing.. Also {{if cached_rows:}} returns always False.

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Massimo DiPierro
try pickle and unpickle this: rows = db(db.tests.id>0).select(cache=(cache.disk, 200), cacheable=True) perhaps something is failing there? On Sep 13, 2012, at 2:14 PM, Niphlod wrote: > uhm. web2py 2.0.8 ... this works > > rows = db(db.tests.id>0).select(cache=(cache.disk, 200)) > rows = db(db.

[web2py] Re: Howto? Host 2 or more applications in a single web2py folder to google app engine

2012-09-13 Thread Pystar
What exactly do you mean by namespaces here? And wouldnt a simpler solution be to have another install of web2py and develop the other app there and upload to GAE? On Thursday, September 13, 2012 12:43:47 PM UTC+1, Massimo Di Pierro wrote: > > yes but they will share the db unless the apps use n

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Niphlod
uhm. web2py 2.0.8 ... this works rows = db(db.tests.id>0).select(cache=(cache.disk, 200)) rows = db(db.tests.id>0).select(cache=(cache.disk, 200)) print rows.find(lambda row: row.id == 1) this don't rows = db(db.tests.id>0).select(cache=(cache.disk, 200), cacheable=True) rows = db(db.tests.id>0

Re: [web2py] SOAP XML Return Objects

2012-09-13 Thread Mariano Reingart
Hello devrunner: If you want to use pysimplesoap (that comes with web2py), you can create complex types using python dicts: @service.soap('FEDummy',returns={'FEDummyResult': {'AppServer': str, 'DbServer': str, 'AuthServer': str}},args={}) def dummy(): return {'AppServer': 'OK', 'DbServer': 'O

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Bruno Rocha
The same problem without cacheable --

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Niphlod
I'm getting weird behaviours trying to reproduce if you remove cacheable=True will the find() method work or not ? On Thursday, September 13, 2012 8:53:16 PM UTC+2, rochacbruno wrote: > > Yes, it raises the same error when using cache.disk, so I think for now we > should include a note on /b

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Bruno Rocha
Yes, it raises the same error when using cache.disk, so I think for now we should include a note on /book. and I will try to emulate the .find .exclude and .sort externally using listcomprehension or map. --

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Niphlod
a little pointer. find(), exclude(), etc are methods of a "rows" object. Can you please try to cache using cache.disk ? If the error is the same, this is the "unfair" difference from cache.ram (that can cache pointers to a functions, objects, singletons, etc) vs all the other methods that ha

[web2py] Re: HTTPS Admin Page Remote Connection

2012-09-13 Thread Niphlod
why don't you just enable remote forwarding if you don't want to setup the SSL on the webserver ? if you can log in with ssh, you should be able to do: ssh -L local_port:local_ip:remote_port username@address This, in addition to login to the ssh shell, will redirect the services listening on t

Re: [web2py] Is there anyway to register a user manually just like login_bare? I am using it in the mobile app.

2012-09-13 Thread Bruno Rocha
*Create this function in some model* * * > *def new_user(first_name, last_name, email, passw): > **users = db(db.auth_user.email==email).select() > **if users: > **return users[0].id > **else: > **my_crypt = CRYPT(key=auth.settings.hmac_key) > **

[web2py] Is there anyway to register a user manually just like login_bare? I am using it in the mobile app.

2012-09-13 Thread Kenny
login_bare is so useful for accessing the database manually in mobile application, is there anyway to let the users to register the website via mobile application? ex) register_bare(id,password) -> Save it in the database -> user is registered. I wasn't able to find how I should make this reg

[web2py] Re: Edit or delete not committing in sqlform.grid for custom query

2012-09-13 Thread Mandar Vaze
For now, I'm calling db.commit on my own ondelete function def my_ondelete_function(table, record_id): print "Deleting %s from %s" % (record_id, table) db(table[table._id.name]==record_id).delete()

Re: [web2py] Beginner trying to adapt the Chapter 11 ajax function 'echo' example

2012-09-13 Thread Bruno Rocha
The ajax function: ajax( url, # here you set a string to a complete url, it can include args and vars [], # form inputs, if you have a form on the page you can set ['name', 'email'] if you do not have a form set it to null target, # an id of any html element where you want the re

[web2py] Re: Edit or delete not committing in sqlform.grid for custom query

2012-09-13 Thread Mandar Vaze
I'm using version 2.0.7 and seeing the same problem. I looked at the gluon/sqlhtml.py and it doesn't look like problem is specific to custom query (Although I too have custom query passed to the sqlform.grid) elif deletable and len(request.args)>2 and request.args[-3]=='delete':

[web2py] Re: Edit or delete not committing in sqlform.grid for custom query

2012-09-13 Thread Mandar Vaze
I'm using version 2.0.7 and seeing the same problem. I looked at the gluon/sqlhtml.py and it doesn't look like problem is specific to custom query (Although I too have custom query passed to the sqlform.grid) elif deletable and len(request.args)>2 and request.args[-3]=='delete':

Re: [web2py] LOAD Ajax

2012-09-13 Thread Anthony
Did you try URL(..., extension=False)? Anthony On Thursday, September 13, 2012 1:46:36 PM UTC-4, Hassan Alnatour wrote: > > > Still having the same problem , what should i do ? > > > > > On Mon, Sep 10, 2012 at 2:10 PM, tomasz bandura > > > wrote: > >> try LOAD() with extension=False >> >> >>

[web2py] HTTPS Admin Page Remote Connection

2012-09-13 Thread Francisco Barretto
Hi There! Deploying web2py on a server gives me some headache about accessing the admin page (on server) from a remote machine. First it throwed the message "'Admin is disabled because insecure channel'. So I found some posts talking about comment the following code i

Re: [web2py] Adding cancel button - form submission

2012-09-13 Thread Henrik Holm
Has this "add_button" been added to one of the recent releases? I'm running 1.99.7 and I get * 'SQLFORM' object has no attribute 'add_button'* Maybe it's time to upgrade :-) Thanks, Henrik On Tuesday, July 17, 2012 1:43:08 PM UTC-4, Massimo Di Pierro wrote: > > In trunk: > > form.add_but

[web2py] HTTPS Remote Admin Page Access

2012-09-13 Thread Francisco Barretto
Hi There, I'm trying to use web2py in a ubuntu server without graphic interface so I need to access the admin page remotely. Started the server with ip 0.0.0.0 and port 8000 and got the message: "Admin is disabled because insecure channel" I saw some users commenting the above part of access.py

Re: [web2py] LOAD Ajax

2012-09-13 Thread Andrew W
You don't use LOAD() in the page.load file, you use it to from another x.html file to load the page.load. Is that what you were doing? --

[web2py] Beginner trying to adapt the Chapter 11 ajax function 'echo' example

2012-09-13 Thread Andrew W
Not sure, but try adding the attribute name= to the element. --

[web2py] Beginner trying to adapt the Chapter 11 ajax function 'echo' example

2012-09-13 Thread Andrew W
The book example is specifically talking about field names in a form. You have an id for a HTML element. Maybe it is field/form specific, in that it is getting the text from the specific named field. --

Re: [web2py] LOAD Ajax

2012-09-13 Thread hasan alnator
Still having the same problem , what should i do ? On Mon, Sep 10, 2012 at 2:10 PM, tomasz bandura wrote: > try LOAD() with extension=False > > > 2012/9/10 Hassan Alnatour > > > > >> Dear ALL , >> >> i am having problems when i use the LOAD() in the page.load if i add >> any CSS with imag

Re: [web2py] Many-many options

2012-09-13 Thread Andrew W
Yes option 1 sounds right. Otherwise you're entering 4th normal form territory http://en.wikipedia.org/wiki/Fourth_normal_form There may be many ways to do things in web2py, but you should still have a good database design. --

Re: [web2py] fake_migrate options works, but then problem when taken out

2012-09-13 Thread MichaelF
I don't know where the lower case is_home_team is coming from. In the entire app dir it appears only in the error pages. The 'migrate = true, fake_migrate = true' yields the same error. On Thursday, September 13, 2012 11:14:32 AM UTC-6, Marin Pranjić wrote: > > What about the case > Is_home_team

Re: [web2py] fake_migrate options works, but then problem when taken out

2012-09-13 Thread Marin Pranjić
What about the case Is_home_team / is_home_team? On Sep 13, 2012 6:37 PM, "MichaelF" wrote: I have a field ('Is_home_team') that was defined as 'boolean', and I changed it to 'integer'. The migrate failed (I'm using MySQL). I then invoked the following on the table def that defines Is_home_team

Re: [web2py] fake_migrate options works, but then problem when taken out

2012-09-13 Thread Marin Pranjić
Can you try Migrate = true Fake_migrate = true On Sep 13, 2012 6:37 PM, "MichaelF" wrote: I have a field ('Is_home_team') that was defined as 'boolean', and I changed it to 'integer'. The migrate failed (I'm using MySQL). I then invoked the following on the table def that defines Is_home_team:

Re: [web2py] Many-many options

2012-09-13 Thread Richard Vézina
:) Richard On Thu, Sep 13, 2012 at 12:15 PM, MichaelF wrote: > Thanks. Yes, option 1 is the 'approved' solution, I think. It doesn't get > tricky. > > And thanks for the link. I like anti-pattern books...great sanity checks. > Unfortunately, I find a lot of my code in them! :) > > > On Thursday

[web2py] fake_migrate options works, but then problem when taken out

2012-09-13 Thread MichaelF
I have a field ('Is_home_team') that was defined as 'boolean', and I changed it to 'integer'. The migrate failed (I'm using MySQL). I then invoked the following on the table def that defines Is_home_team: migrate = False, fake_migrate = True I also altered the underlying MySQL table to change th

Re: [web2py] Many-many options

2012-09-13 Thread MichaelF
Thanks. Yes, option 1 is the 'approved' solution, I think. It doesn't get tricky. And thanks for the link. I like anti-pattern books...great sanity checks. Unfortunately, I find a lot of my code in them! :) On Thursday, September 13, 2012 9:45:38 AM UTC-6, Richard wrote: > > In this case the be

Re: [web2py] Is there an easy way to do this?

2012-09-13 Thread Richard Vézina
Also, you may have to customize insertion, about that you can search the book about multiple form there is a snippet code for manual insertion. In your case you don't need field_filter, you just need a for loop I think since you only have one table. Richard On Thu, Sep 13, 2012 at 11:41 AM, Rich

Re: [web2py] Many-many options

2012-09-13 Thread Richard Vézina
In this case the best approach will be to have a normalized schema that allow to use all the constraint required at the DB level... I think yo said the first proposal you made allow that... I like this book when it comes to tricky design, it gives ideas on how to solve the issues : http://pragprog

Re: [web2py] Is there an easy way to do this?

2012-09-13 Thread Richard Vézina
It totally feasible! It only depends of the number of the parameters you have in your table... If you have less than a 1000, it should not overload the browser, or you can think of paging the table. Massimo, has wrote in the pass that it could be possible to une SQLFORM.grid in order to make a mu

Re: [web2py] Many-many options

2012-09-13 Thread MichaelF
The P3 record will have text and/or file information that relates to several P1 records, or several P2 records, and sometimes both several P1 and several P2 records. The text info will be used to add to a document (a totally separate entity outside the db), and the file will be attached to the

Re: [web2py] Many-many options

2012-09-13 Thread Richard Vézina
Maybe with more details about the nature of the information to store, it could be easier to give an answer... You can also use the junction table to store weak entity attribute, that could avoid the P3 table. Richard On Thu, Sep 13, 2012 at 11:01 AM, MichaelF wrote: > This might be more of a S

[web2py] Many-many options

2012-09-13 Thread MichaelF
This might be more of a SQL design question, but if web2py handles one better than another, that would be good to know. Suppose I have three 'parent' records ((P1, P2, and P3), and I want to link P1 records with P3 records, and also P2 records with P3 records. Several options: Option 1: obviou

Re: [web2py] Validating form fields manually

2012-09-13 Thread Bruno Rocha
You can read the read-only or hidden fields from the form directly on request.vars, instead of form.vars use request.vars and it should work. --

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Massimo DiPierro
I am not sure. Please open a ticket do it gets tracked. On Sep 13, 2012, at 9:03 AM, Bruno Rocha wrote: > I noted that this happens with memcached too. > > 'list' object has no attribute 'find' > > My cached .select(cache=(cache.memcache, 1200)) is retrived as a list. > > Function argument li

[web2py] Re: Postgresql and unix_sock

2012-09-13 Thread Liam
Great :) Just what I was looking for. Thanks. Others will have to comment if they've encountered this, but it seems pretty rare. I did a lot of digging, but couldn't find other examples. On Thursday, September 13, 2012 1:47:53 PM UTC+2, Massimo Di Pierro wrote: > > You can do it without changing

[web2py] Re: on Redis Rows turns in to list() ?

2012-09-13 Thread Bruno Rocha
I noted that this happens with memcached too. 'list' object has no attribute 'find' My cached .select(cache=(cache.memcache, 1200)) is retrived as a list. Function argument list (menus=[, , , , ], visibility=1, parent=None, place='top') Code listing 148. 149. 150. 151. 152. 153. 154. 155.

[web2py] Re: Remember to delete examples application or become a spam farm

2012-09-13 Thread Jose C
Or, if using parameter-based routing, use the `applications` option to list which of your apps you want to be accessible. For example, routers = dict( BASE = dict( default_application = 'app1', applications = ['admin','app1','app2'] root_static = ['favicon.ico','robots

[web2py] web2py and the dropbox api

2012-09-13 Thread peter
This is not exactly a web2py issue, but other users might have useful input, and the answer will maybe help others. I am trying to put a file onto dropbox. After setting everything up, I do f = open('myfile.zip') client.put_file('myfile.zip',f) If the file is a small textfile it works f

[web2py] Re: form checkbox keepvalues

2012-09-13 Thread Peter
Hi, I have this: tuple1 = [] for k in data.domain.attributes: tuple1.append(k.name) form = FORM(TR(SELECT(_name='search_category_1', *[OPTION(tuple1[i], _value=i) for i in range(len(tuple1))]), value=request.vars.search_category_1), TR("",INPUT(_type="text"

[web2py] Form upload with cURL

2012-09-13 Thread Dirk Krause
Hi, I finally figured out to do a file upload via curl (may be obvious to everybody else, but not to me ...) so here we go: I followed the 'manual file upload' example over at web2pyslices (thanks, Yarin!): http://www.web2pyslices.com/slice/show/1504/manual-uploads Just for clarity I changed

Re: [web2py] Validating form fields manually

2012-09-13 Thread Mandar Vaze
Hi, I have two scenario that require manual validation - Adding a new record and updating existing record. Record only has two fields. It is an associative table for many-to-many relationship. I need to ensure that this pair is unique (I considered using primarykey=['task', 'owner'] - but it ha

[web2py] Re: Postgresql and unix_sock

2012-09-13 Thread Massimo Di Pierro
You can do it without changing the source db = DAL(...,driver_args={'unix_sock':'/tmp/.s.PGSQL.5432'}) How common is this scenario? On Thursday, September 13, 2012 3:55:22 AM UTC-5, Liam wrote: > > Hi all, > > Due to a strange Postgresql setup by my systems admin, I can not specify > the host a

[web2py] Re: Howto? Host 2 or more applications in a single web2py folder to google app engine

2012-09-13 Thread Massimo Di Pierro
yes but they will share the db unless the apps use namespaces. On Wednesday, September 12, 2012 11:07:33 PM UTC-5, Pystar wrote: > > I have one web2py installation on my system containing 2 applications. I > want to upload both to google app engine. How do I specify that in the > app.yaml file?

[web2py] Re: comprehensive cheetsheet

2012-09-13 Thread Massimo Di Pierro
good idea. On Wednesday, September 12, 2012 9:06:45 PM UTC-5, Andrew W wrote: > > Thankyou, an excellent resource. > > If I could suggest one more, and I'd be happy to attempt this. I don't > know about others, but before I can make any sense of a page's layout and > what other people are sayi

[web2py] Re: Bug? crud.settings.auth NOT set. Forces login and all crud urls yield insuficient priveleges message

2012-09-13 Thread Massimo Di Pierro
Can you email me your app? Could be a bug in web2py but it will be easier to check it with your app. Massimo On Wednesday, September 12, 2012 8:38:27 PM UTC-5, JoeCodeswell wrote: > > Dear web2py Group, > > I am running 2.0.8 on win xp. > I created a new simple app named forms. > I added some ta

[web2py] Beginner trying to adapt the Chapter 11 ajax function 'echo' example

2012-09-13 Thread AnnG
Hi, I am trying to get a set of list items that if clicked or the mouseover event occurs, it updates another div element. I started with that chapter 11 echo example: * default/index.html: {{extend 'layout.html'}} default.py * def index(): return dict() def ec

[web2py] Re: remote access to admin

2012-09-13 Thread Justin Sun
I just do as you said, but I can't work it out. Can you make it more detailed ? 在 2008年11月18日星期二UTC+8上午5时22分12秒,davidjensen写道: > > I just solved the problem with help from someone else. > It seems to do with executing mv parameters_8000.py parameters_80.py > after starting and stopping web2py

[web2py] Re: on Redis Rows turns in to list() ?

2012-09-13 Thread Niphlod
redis should only pickle whatever it is passed along... I can review it later tonight if the latest "cache" addition broke something. BTW: the problem with very long keys in memcache was faced before, I'm pretty sure there is some commit around 1.99.4 to fix the issue... insn't this line intende

[web2py] Postgresql and unix_sock

2012-09-13 Thread Liam
Hi all, Due to a strange Postgresql setup by my systems admin, I can not specify the host as "localhost" to connect to my production database. Instead, I have to specify the unix socket. This is currently unsupported in web2py, but I came up with a temporary workaround for the time being. In a

[web2py] Re: Appadmin not showing default widgets for plugin tables

2012-09-13 Thread scausten
Ah, of course, thank you. On Wednesday, 12 September 2012 17:07:48 UTC+1, Niphlod wrote: > > format is missing for the clients table . > > how should web2py show the clients records in the dropdown of the > "newly/currently editing" record of promotions ? > > Il giorno mercoledì 12 settembre

[web2py] Re: Redis: RedisCache error

2012-09-13 Thread Niphlod
How did you enter this shell ? Is this problem present also when using the cache inside a normal web-application ? On Thursday, September 13, 2012 5:14:11 AM UTC+2, devrunner wrote: > > Any idea guys what's the problem in this error: > > >>> from gluon.contrib.redis_cache import RedisCache > >>>