[web2py] Re: Remembering selections for form submission

2012-05-12 Thread Neil
Actually, I fixed it another way. My problem was that I was using the same options as input for multiple SELECT()s. If I create new instances of OPTIONS() for each drop-down box, the state is correctly remembered. Thanks, Neil On Saturday, May 12, 2012 12:22:13 AM UTC+1, Massimo Di Pierro

[web2py] Web-framework+db with the widest scalability?

2012-05-12 Thread Alec Taylor
Disclosure: I have posted this on stackoverflowhttp://stackoverflow.com/q/10562165and comp.lang.pythonhttps://groups.google.com/forum/#%21topic/comp.lang.python/gSAw5mLkUos . I am building a project requiring high performance and scalability, entailing: - Role-based

[web2py] Re: MongoDB Adapter error in select

2012-05-12 Thread Francisco Costa
It works Massimo! In MongoDb is also common to insert dicts, can we also have that? At the moment it only saves in the string format (check player Field) { _id : ObjectId(4fae3839b34f4brf5a31), city : Madrid, club : Real Madrid, *player : {'n_goals': 43, 'name': 'Ronaldo'}* } On Friday,

[web2py] Nested views.

2012-05-12 Thread Annet
I renamed layout.html 'scaffold.html' and adjusted it to suit my needs. Furthermore, I have a number of controllers which all have their generic view: controller/generic.html. For example the cmsvcard controller has the following generic.html view: {{extend 'scaffold.html'}} {{if

[web2py] Re: 404 access denied problem with janrain on cube2py

2012-05-12 Thread Paulo Junqueira da Costa
Hi, I´m having the same problem. My domain is condomniovip, and the whole auth process is going fine, except plugin-wiki. from gluon.contrib.login_methods.rpx_account import RPXAccount auth.settings.actions_disabled=['register','change_password','request_reset_password']

[web2py] Re: 404 access denied problem with janrain on cube2py

2012-05-12 Thread Paulo Junqueira da Costa
Hi, I´m having the same problem. The whilw atuh is working fine, except for plugin_wiki. from gluon.contrib.login_methods.rpx_account import RPXAccount auth.settings.actions_disabled=['register','change_password','request_reset_password'] auth.settings.login_form = RPXAccount(request,

[web2py] IS_IN_DB

2012-05-12 Thread lucas
hello one and all, this has probably been asked, and i sifted through the search, but didn't really find it. i am trying to replicate the Database Administrator side of web2py when it references another record by id in another table. so my model is like Field('user_id', db.auth_user,

[web2py] Re: class 'sqlite3.ProgrammingError' Cannot operate on a closed database.

2012-05-12 Thread Yarin
Think the combination of persistant logger object and SQLite threading issues makes this too hard (couldn't get it working with commit() either)- I'll look for a simpler solution. (PS- For non web2py-DAL sqlite logging, I stumbled upon a thread safe class I built a while back- still works, in

[web2py] Re: Nested views.

2012-05-12 Thread Anthony
{{include}} An include like the above that doesn't reference a specific view only works when the view that contains it is extended by another view. So, if you want your cmsvcard/index.html card to extend the cmsvcard/generic.html view, you have to include an extend directive: In

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Bruce Wade
I am starting to think the design loading everything in models with every request, all though makes for rapid development isn't a very good design. Maybe for common settings in witch case the folder shouldn't be called models. I need to go through my app completely and remove everything from

[web2py] Re: Nested views.

2012-05-12 Thread Annet
Hi Anthony, Thanks for your reply, and explanation. Your explanation made me reconsider my design choice. I now simply have cmsvcard/index.html extend cms/generic.html and cms/generic.html extend scaffold.html and in scaffold.html and cms/generic.html I have an {{include}}. In the

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Anthony
On Saturday, May 12, 2012 10:51:59 AM UTC-4, Bruce Wade wrote: I am starting to think the design loading everything in models with every request, all though makes for rapid development isn't a very good design. Maybe for common settings in witch case the folder shouldn't be called models.

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Bruce Wade
Yeah I am going through all my controllers right now to see if I can use the folder solution. Which way would be faster? Folders or modules? On Sat, May 12, 2012 at 8:52 AM, Anthony abasta...@gmail.com wrote: On Saturday, May 12, 2012 10:51:59 AM UTC-4, Bruce Wade wrote: I am starting to

[web2py] SQLFORM not print the ID values ​​less and equal than zero from the referenced table

2012-05-12 Thread Eduardo Diaz
In our work we migrate from version of Web2py from 1.96.4 to 1.99.7, but we have the following problem: SQLFORM not print the ID values ​​less and equal than zero, the referenced table (ex. table a). any security reason for this change? # controller: debug.py def index():

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Bruce Wade
OK so I am working on this technique what do you think? API File: youadAPI.adviewer_api from gluon import * class AdViewerEngine: class tables: AdReports = 'adreports' Ads = 'ads' AdveiwerSettings = 'adviewer_settings' Keywords = 'keywords' AdKeyword =

[web2py] Re: crud.create causes an id problem

2012-05-12 Thread Najtsirk
I'm not too good at this stuff...but i think i had similar problem. In my controller I set the default value for the crud.create reference field: db.table.referenceid.default = request.args(0) form=crud.create(db.table) I solved the problem with: db.table.referenceid.default =

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Anthony
On Saturday, May 12, 2012 12:06:28 PM UTC-4, Bruce Wade wrote: Yeah I am going through all my controllers right now to see if I can use the folder solution. Which way would be faster? Folders or modules? Well, a model file still has to be read each time it is needed, whereas a module

Re: [web2py] Re: storing more than 1 millions uploaded files

2012-05-12 Thread Sebastian E. Ovide
just wondering... (I know that it is not a normal application)... where would you store a couple of millions pictures of less than 60K each ? On Sat, May 12, 2012 at 2:04 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Oops. Sorry. I read it in a hurry. I would not use the file

Re: [web2py] Re: storing more than 1 millions uploaded files

2012-05-12 Thread nils
Amazon's S3 is ideal for this, I use it I mount s3 using fuse interface. Works pretty well for me. Nils On May 12, 2012 7:53 PM, Sebastian E. Ovide sebastian.ov...@gmail.com wrote: just wondering... (I know that it is not a normal application)... where would you store a couple of millions

Re: [web2py] To uuid or not?

2012-05-12 Thread Sebastian E. Ovide
I find that using the ID works perfectly well... I'm using UUID only on those situations where I need to pass it as vars/args (URLS for example) so that hackers cannot guess the IDs what problems have you got moving the DB to another computer ? On Fri, May 11, 2012 at 2:07 PM, Johann Spies

[web2py] deleting row with files

2012-05-12 Thread Sebastian E. Ovide
Hi All, I have a table with a Field('image1', type='upload', uploadseparate=True), The upload works well nevertheless when I delete the a record, the image is left in the server (of course it doesn't happen if I store the file in the DB) Is it working as expected ? any way to

Re: [web2py] deleting row with files

2012-05-12 Thread Bruno Rocha
autodelete=True On Sat, May 12, 2012 at 4:15 PM, Sebastian E. Ovide sebastian.ov...@gmail.com wrote: Hi All, I have a table with a Field('image1', type='upload', uploadseparate=True), The upload works well nevertheless when I delete the a record, the image is left in the server

Re: [web2py] deleting row with files

2012-05-12 Thread Sebastian E. Ovide
nice... it works (I suspect that the subfolder that was self generated is not deleted as it will be created anyway at some point...) On Sat, May 12, 2012 at 8:30 PM, Bruno Rocha rochacbr...@gmail.com wrote: autodelete=True On Sat, May 12, 2012 at 4:15 PM, Sebastian E. Ovide

[web2py] complex query with delete

2012-05-12 Thread Vincenzo Ampolo
Hi, In the web2py book I've seen simple delete queries like: db(db.person.id 3).delete() where it's easy to understand that the persons with id 3 will be deleted from db.person.id but what if i want to delete rows selected with this query:

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Michele Comitini
I keep saying it but nobody listens :-) USE THE PROFILER You wasting *your* time trying to guess where the application is wasting *its* time. mic 2012/5/12 Anthony abasta...@gmail.com: On Saturday, May 12, 2012 12:06:28 PM UTC-4, Bruce Wade wrote: Yeah I am going through all my controllers

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Bruce Wade
lol, yeah I guess that is my problem with being a C++ coder. But I also seen that 90 tables were loaded with every request ;) On Sat, May 12, 2012 at 1:50 PM, Michele Comitini michele.comit...@gmail.com wrote: I keep saying it but nobody listens :-) USE THE PROFILER You wasting *your* time

[web2py] complex query with delete

2012-05-12 Thread Andrew
Not that I've tried it, but does this syntax from the book help ? rows = db(db.person).select(join=db.dog.on(db.person.id==db.dog.owner)) Does replacing select with delete work?

[web2py] complex query with delete

2012-05-12 Thread Andrew
P.s. I assume you are wanting to delete from keyword ? That is why it is ambiguous with joins, which one is the target ?

[web2py] missing required field error on column with default value defined?

2012-05-12 Thread Yarin
I've got a table with the following field defined: Field('archived', 'boolean',default=False, required=True), and yet, I'm getting the following error on insert: type 'exceptions.SyntaxError' Table: missing required field: archived How could this be? The table has a default specified?

[web2py] Re: missing required field error on column with default value defined?

2012-05-12 Thread Anthony
From the book: default sets the default value for the field. The default value is used when performing an insert if a value is not explicitly specified. required tells the DAL that no insert should be allowed on this table if a value for this field is not explicitly specified. required=True

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Bruno Rocha
Do you have images being seved by web2py using the default download function? On Sat, May 12, 2012 at 7:51 PM, Bruce Wade bruce.w...@gmail.com wrote: Ok so I started it with the profile to be honest need some guidance on how to read this report. But like the one call there is 582,237 function

[web2py] Re: missing required field error on column with default value defined?

2012-05-12 Thread Yarin
That makes sense- thank you On Saturday, May 12, 2012 6:57:59 PM UTC-4, Anthony wrote: From the book: default sets the default value for the field. The default value is used when performing an insert if a value is not explicitly specified. required tells the DAL that no insert should be

Re: [web2py] Re: Nginx-uwsgi problem.

2012-05-12 Thread Bruce Wade
Shouldn't be as I have deleted that default function. On May 12, 2012 4:36 PM, Bruno Rocha rochacbr...@gmail.com wrote: Do you have images being seved by web2py using the default download function? On Sat, May 12, 2012 at 7:51 PM, Bruce Wade bruce.w...@gmail.com wrote: Ok so I started it

[web2py] Bootstrap and custom forms and widgets

2012-05-12 Thread Matt
Hi Everybody, I'm using bootstrap for a project with web2py. I want to create forms that mirror the standard approach taken by the bootstrap framework. They wrap each control like so: div class=control-group error label class=control-label for=inputErrorInput with error/label

[web2py] Possible change to SQLFORM

2012-05-12 Thread Matt
Hi there, Potential change / improvement to SQLFORM. At present when you do the following: def user(): form = auth() form['_class'] = 'mystyle' return dict(form = form) user.html {{= form.custom.begin }} You get the following output: form action= enctype=multipart/form-data

[web2py] Re: Possible change to SQLFORM

2012-05-12 Thread Anthony
It would be tricky because form.custom.begin is not like the form.custom widgets, which are just references to HTML helper objects within the form object (so it's easy to add attributes). It cannot be a helper object because it only represents the opening form tag, not the complete HTML form

[web2py] Re: Bootstrap and custom forms and widgets

2012-05-12 Thread Anthony
http://web2py.com/books/default/chapter/29/7#Hide-errors Anthony On Saturday, May 12, 2012 11:35:52 PM UTC-4, Matt wrote: Hi Everybody, I'm using bootstrap for a project with web2py. I want to create forms that mirror the standard approach taken by the bootstrap framework. They wrap

[web2py] Re: IS_IN_DB

2012-05-12 Thread Annet
Hi Lucas, What about: Field('user_id', db.auth_user, requires=IS_IN_DB(db, 'auth_user.id','%(last_name)s, %(first_name)s (%(id)s)')) 'auth_user.id' instead of db.auth_user.id You could use a developer tool's inspect element function or just view the page's source code to see if the select