[web2py] Re: Bootstrap and custom forms and widgets

2012-05-13 Thread Matt
Brilliant thanks for that. Matt On Sunday, 13 May 2012 15:53:19 UTC+12, Anthony wrote: 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

[web2py] Re: Possible change to SQLFORM

2012-05-13 Thread Matt
Ok. No worries. Matt On Sunday, 13 May 2012 15:51:16 UTC+12, Anthony wrote: 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

[web2py] error deleting a row if the file uploaded is missing?

2012-05-13 Thread Sebastian E. Ovide
Hi All, I have a table with Field('image1', type='upload', uploadseparate=True, autodelete=True), If the file uploaded is missing (because deleted by hand for example) then I would get this error trying to delete a row db(db.service.id==1).delete() Traceback (most recent call last): File

[web2py] db two selects

2012-05-13 Thread BlueShadow
Hi I got A table for articles on my page wich contains a variable for the date it was submitted and the number of views (content title...) I tried to do a select which gives me the newest five of this table (orderedby=~article.date) Now I want to sort those five by the number of views. I tried

[web2py] reverse ajax on free hosting like fluxflex / pythonanywhere

2012-05-13 Thread Stefaan Himpe
Hello list, Would anyone have an idea on how to accomplish reverse ajax (server push) on free hosting like fluxflex/pythonanywhere? If I'm correct, typical comet libraries require special web servers, so that is probably out of the question on typical free hosting sites. For my own

Re: [web2py] complex query with delete

2012-05-13 Thread Vincenzo Ampolo
On 05/13/2012 12:02 AM, Andrew wrote: Does replacing select with delete work? Nope, i got: TypeError: delete() got an unexpected keyword argument 'join' It seems that delete does not accept any argument at all! Yeah. I want to delete from db.keyword If delete was more like select() would

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

2012-05-13 Thread Michele Comitini
Alec, The database depends on what data you store and serve. It depends on your model. Postgresql is pretty generic and scales (Skype use postgresql). web2py has all the required layers for your requirements and scales: just put nginx in front of scgi, uwsgi, fcgi and use processes not threads.

Re: [web2py] complex query with delete

2012-05-13 Thread Anthony
db((db.keyword.id!=db.users_keywords.keyword_id)(db.keyword.dictionary==dictionary)).delete(db.keyword) Exactly what set of records are you trying to delete from db.keyword? Are you trying to identify keywords that are not referenced by any records in db.users_keywords? If so, how about

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

2012-05-13 Thread Alec Taylor
Thanks, I'll give Postgres a go. Quick semi-related question: have their been benchmark comparisons on recent versions on Django when compared with recent version on web2py? E.g.: for requests per second, processing time etc On Sun, May 13, 2012 at 10:47 PM, Michele Comitini

[web2py] Re: db two selects

2012-05-13 Thread Anthony
orderedby=~db.article.date|~db.article.views should work. Did you try exactly that code? Anthony On Sunday, May 13, 2012 4:43:24 AM UTC-4, BlueShadow wrote: Hi I got A table for articles on my page wich contains a variable for the date it was submitted and the number of views (content

[web2py] Re: db two selects

2012-05-13 Thread BlueShadow
def index(): rows=db().select(db.article.ALL, orderby=~db.article.submitted|~db. article.views, limitby=(0,5)) return dict(Articles=rows) Thats my code from the default.py removing and adding the second ~ doesn't change anything. in my index.htm I simply print the Titles and

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

2012-05-13 Thread Anthony
Quick semi-related question: have their been benchmark comparisons on recent versions on Django when compared with recent version on web2py? I'm not aware of any benchmarks directly comparing Django and web2py. If you were to make a comparison, you would have to be careful to make sure

[web2py] Re: db two selects

2012-05-13 Thread Anthony
Hmm, I tried a similar query and it properly respects both ~'s. Can you pack and attach a minimal app (using SQLite) that exhibits the problem? Anthony On Sunday, May 13, 2012 9:14:27 AM UTC-4, BlueShadow wrote: def index(): rows=db().select(db.article.ALL,

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

2012-05-13 Thread Keith Edmunds
On Sun, 13 May 2012 06:21:17 -0700 (PDT), abasta...@gmail.com said: I suspect there wouldn't be much difference in performance between the two frameworks (similarly and properly configured). So long as this is broadly true (which I suspect it is), there are other considerations to take into

[web2py] Common controller functionality

2012-05-13 Thread Yarin
I've always liked the idea of controllers as classes, allowing for subclassing of controllers, and thereby providing an easy means of handling common controller functionality. I'm curious as to why web2py didn't follow this approach? Is there a recommended way of handling code that is common

Re: [web2py] Common controller functionality

2012-05-13 Thread Sebastian E. Ovide
what about using modules ? you can create as many classes as you want and then just use them. On Sun, May 13, 2012 at 5:31 PM, Yarin ykess...@gmail.com wrote: I've always liked the idea of controllers as classes, allowing for subclassing of controllers, and thereby providing an easy means

[web2py] Re: Common controller functionality

2012-05-13 Thread simon
You can put common controller functionality in the model. This is executed on each request before the controllers. You can check which controller is called in request.controller. On Sunday, 13 May 2012 17:31:22 UTC+1, Yarin wrote: I've always liked the idea of controllers as classes, allowing

[web2py] Re: web2py - form to pass input to matplotlib

2012-05-13 Thread Massimo Di Stefano
i'm looking for a solution, to start to write a web-app to generate graph using matplotlib the graph needs to be generated using some inputs parameters coming from the page itself. right now i'm rewriting the app from scratch .. but i'm stuck on how to integrate a query button to the python

[web2py] Re: Common controller functionality

2012-05-13 Thread Yarin
That's what I've already been doing, but making decisions in the model on which code to run based on the request controller turns into a hot mess of distributed logic and violates the most basic principles of MVC (Models knowing about Controllers?) On Sunday, May 13, 2012 1:58:25 PM UTC-4,

[web2py] Online editor in Chrome browser in Dev build

2012-05-13 Thread Hardik Mehta
Hi, Does anyone have a scroll problem in online editor in Chrome browser using the dev build? Whenever I open a file in the online editor, and if I try to scroll, it scrolls back to the top in Chrome. It works fine in Firefox. I am using Chrome version 18. Thanks. Hardik Mehta

Re: [web2py] Re: Common controller functionality

2012-05-13 Thread Sebastian E. Ovide
in Java (say for example Java EE 6), you would have your own Classes hierarchy (as extended as needed), and then you would inject what you need in your controllers (backing beans)... in web2py you can do exactly the same. Create your own hierarchy of classes (as extended as needed) and then just

[web2py] Re: Common controller functionality

2012-05-13 Thread pbreit
You can put functions in controller files that any other function in the file can call.

[web2py] Re: Integrating error pages in web2py on app engine

2012-05-13 Thread howesc
my routes on_error used on GAE (collects 400 and 500 errors unless GAE itself throws the error before web2py gets the request): routes_onerror = [ ('appname/*', '/appname/home/missing.html'), ] On Friday, May 11, 2012 8:18:11 PM UTC-7, Sushant Taneja wrote: Yes I did configure the

Re: [web2py] Re: Common controller functionality

2012-05-13 Thread Yarin
Sebastian- I already have class hierarchies for my model/module stuff. What I'm talking about using classes to handle controller logic- assembling views, controlling access, processing forms, managing redirection, etc - that stuff belongs in controllers, not modules. But the flat, one

[web2py] db two selects

2012-05-13 Thread pbreit
I'm not sure that query will do what you want. I think you need to sort by views separately.

Re: [web2py] Re: Common controller functionality

2012-05-13 Thread Sebastian E. Ovide
Yarin, I see... I know what you mean... I had a quick glance into compileapp.py line 555... (I guess that it the right place to look at)... and it looks like that inheritance is not part of it... filename = os.path.join(folder, 'controllers/%s.py' % controller)

[web2py] empty field

2012-05-13 Thread lucas
how come i have to test an empty string field within a try|except block like this: try: b = q.create_lecture_foldername!=None except: b = False if b: something instead of the more straight forward: if (q.create_lecture_foldername!=None): something because if i try the previous

[web2py] wysiwyg editor saving ALL in a blob (including pictures)

2012-05-13 Thread Sebastian E. Ovide
Hi All, I've read a couple of tutorials (probably from web2py slices) about HTML wysiwyg + images uploading (in separate table) I was just wondering... what if instead of defining a TEXT field and an additional table for storing images we define a BLOB field and we store ALL there

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

2012-05-13 Thread Michele Comitini
The first numbers to look at are times those are what affect our lives. The number of calls bother just the cpu ;-) 1. time to complete the action 2. cumulative time i.e. where most of the time affecting 1. is spent 3. percall time i.e. to find if there is a function that is really slow 1. is

Re: [web2py] Re: External database query for authentication (RBAC)

2012-05-13 Thread Michele Comitini
You can create a new login_method while keeping the auth tables as usual. The login method will work on the legacy db. The auth table will contain user data in another db, can be sqlite or anything else supported by DAL. Indeed web2py auth tables *do not need to contain secrets*, those can be kept

Re: [web2py] wysiwyg editor saving ALL in a blob (including pictures)

2012-05-13 Thread Vasile Ermicioi
not quite possible because each image has an url, a single blob field is not enough, except if somehow you will manage to convert all images to base64 at the time of inserting/uploading but even so no need for blob, base64 images are represented as text

Re: [web2py] Re: Common controller functionality

2012-05-13 Thread Bruno Rocha
I use /models as a script folder and I always try to avoid the use of this. Controllers are for me only a point of entry, the place where I route and where I got argumuments and I decide about the template rendering. All the rest of logic goes in sub modules, handlers, helpers and datamodels.

[web2py] Re: ImportError with plugin

2012-05-13 Thread Simon Ashley
Has anyone come up with a solution to this? Have the same issue. On Thursday, December 1, 2011 7:08:38 AM UTC+10, haikuvend Resident wrote: I have downloaded a plugin from http://dev.s-cubism.com/plugin_solidform It consists of two files: - controller/plugin_solidform.py (demo) -

[web2py] Re: ImportError with plugin

2012-05-13 Thread Simon Ashley
Answering my own question here. Its a path issue. If you insert the fill path from the applications folder, its found. On Monday, May 14, 2012 8:08:23 AM UTC+10, Simon Ashley wrote: Has anyone come up with a solution to this? Have the same issue. On Thursday, December 1, 2011 7:08:38 AM

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

2012-05-13 Thread Bruce Wade
Youadworld is HUGE some tables even have 50 columns. On May 13, 2012 2:59 PM, pbreit pbreitenb...@gmail.com wrote: 135 tables to run YouAdWorld??

Re: [web2py] Re: ImportError with plugin

2012-05-13 Thread Bruno Rocha
do you have __init__.py in your modules and in your app folders? http://zerp.ly/rochacbruno Em 13/05/2012 19:35, Simon Ashley gregs...@gmail.com escreveu: Answering my own question here. Its a path issue. If you insert the fill path from the applications folder, its found. On Monday, May

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

2012-05-13 Thread Anthony
To cut define_table execution time you could try to put migrate=False, fake_migrate=False, when you call the DAL since in production the model does not change (usually) at runtime. Yes, definitely turn off migrations -- you can do so for the entire connection via: db = DAL(...,

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

2012-05-13 Thread Bruce Wade
How will compiling it effect things as we are actively developing and adding new features almost daily? On Sun, May 13, 2012 at 5:17 PM, Anthony abasta...@gmail.com wrote: To cut define_table execution time you could try to put migrate=False, fake_migrate=False, when you call the DAL since in

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

2012-05-13 Thread Anthony
On Sunday, May 13, 2012 8:37:17 PM UTC-4, Bruce Wade wrote: How will compiling it effect things as we are actively developing and adding new features almost daily? After you make a change, you can just do Remove compiled and then re-compile. You can do it via the admin interface or the

[web2py] Re: Tagging View

2012-05-13 Thread Massimo Di Pierro
correct. On Friday, 11 May 2012 23:59:39 UTC-5, Rod Watkins wrote: Wow, very cool. One question. In the cms app, a page (with an id) already exists so the ajax post to the addtag action can add the tag to the page. In my case the create version of the form will not have an entity with an

[web2py] Re: Is there a way to use an Alias for a COUNT() field

2012-05-13 Thread Massimo Di Pierro
You can still do rows.json() even if you add columns to rows or you change their values. On Saturday, 12 May 2012 00:27:49 UTC-5, Franklin Freitas wrote: If I use what you recommend then what would be the best way to generate the JSON output Thanks Massimo On Saturday, May 12, 2012

[web2py] Re: MongoDB Adapter error in select

2012-05-13 Thread Massimo Di Pierro
I think you can already db.table.insert(**dict()) Are you asking for something different? On Saturday, 12 May 2012 05:25:02 UTC-5, Francisco Costa wrote: 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

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

2012-05-13 Thread Massimo Di Pierro
Please open a ticket. I do not see what may be causing this. On the other ise the ID should be Null(None) or 0 else it will break most databases. On Saturday, 12 May 2012 11:36:06 UTC-5, Eduardo Diaz wrote: In our work we migrate from version of Web2py from 1.96.4 to 1.99.7, but we have the

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

2012-05-13 Thread Massimo Di Pierro
The new web2py (n trunk) has request.args(0,default=0,cast=int) On Saturday, 12 May 2012 13:27:07 UTC-5, Najtsirk wrote: 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:

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

2012-05-13 Thread Massimo Di Pierro
Can you post some examples. I could use this myself but I never got a chance tot try it. On Saturday, 12 May 2012 13:58:01 UTC-5, Nils Olofsson wrote: 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

[web2py] Re: error deleting a row if the file uploaded is missing?

2012-05-13 Thread Massimo Di Pierro
Please open a ticket with the traceback. This needs to be fixed quick. On Sunday, 13 May 2012 03:27:54 UTC-5, sebastian wrote: Hi All, I have a table with Field('image1', type='upload', uploadseparate=True, autodelete=True), If the file uploaded is missing (because deleted by hand for

[web2py] Re: reverse ajax on free hosting like fluxflex / pythonanywhere

2012-05-13 Thread Massimo Di Pierro
Look into gluon/contrib/comet_messaging.py. There is an example in there. Requires tornado. On Sunday, 13 May 2012 07:06:49 UTC-5, stefaan wrote: Hello list, Would anyone have an idea on how to accomplish reverse ajax (server push) on free hosting like fluxflex/pythonanywhere? If I'm

[web2py] Re: web2py - form to pass input to matplotlib

2012-05-13 Thread Massimo Di Pierro
# useful module import os, tempfile, random, cStringIO # setup a temporary working forlder os.environ['MPLCONfigureDIR'] = tempfile.mkdtemp() # main matplotlib modules from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure #

[web2py] SQLFORM factory with multiple correlated tables

2012-05-13 Thread csantos
Hi, Suppose I have two tables, with a one-to-one relationship: db.define_table('user', Field('name')); db.define_table('car', Field('color'), Field('user_id', db.user)) What is the easiest way to create an SQLFORM that would store *correlated*data in both fields? For instance, create a user

[web2py] Can't make db calls with scheduler

2012-05-13 Thread Yarin
I'm using the scheduler and everything is working nicely, except that any calls I make to the db in the task function are ignored- Even though the tasks complete successfully, there's no error, or any indication from the worker that something went wrong. This is happening for both MySQL and

[web2py] Re: Can't make db calls with scheduler

2012-05-13 Thread Massimo Di Pierro
I think you need to db.commit() in the task. Does that solve it? On Sunday, 13 May 2012 21:20:51 UTC-5, Yarin wrote: I'm using the scheduler and everything is working nicely, except that any calls I make to the db in the task function are ignored- Even though the tasks complete

[web2py] Re: Can't make db calls with scheduler

2012-05-13 Thread Yarin
Sorry, figured this out- db calls made with the scheduler need a db.commit() On Sunday, May 13, 2012 10:20:51 PM UTC-4, Yarin wrote: I'm using the scheduler and everything is working nicely, except that any calls I make to the db in the task function are ignored- Even though the tasks

[web2py] Re: wysiwyg editor saving ALL in a blob (including pictures)

2012-05-13 Thread encompass
To me, this is bad idea. You miss out on many of the nice things of having the images in a table. For example, you can index and search the images. The database and your server don't have to be hit so hard because those images are on another server so your pages can load faster.