[web2py] Multi computed fields

2012-05-17 Thread Paolo
Hi all, I have a simple table with 3 computed fields, the function that set their values is almost the same. However, unfortunately I had to set up three different functions because I didn't find a better approach. The code: db.define_table('cities', Field('name', 'string', requ

[web2py] cpdb errors

2012-05-17 Thread Keith Edmunds
I'm trying to copy a database from Sqlite to MySQL using the cpdb.py script. In the manual, it states: cd web2py python scripts/cpdb.py \ -f applications/app/databases \ -y 'sqlite://storage.sqlite' \ -Y 'postgresql://username:password@hocalhost/mydb' However, if I do that I get "gluon p

[web2py] gae + wsgi testing with lettuce and webtest

2012-05-17 Thread amit
The overall setup is that I have a gae, wsgi application and I am trying to include lettuce with webtest to automate the testing. 1. I am trying to run lettuce from myapp/tests/ directory. 2. myapp/tests/features directory contains the features and steps description as input to lettuce. In one

Re: [web2py] Updated slice: nginx and SCGI | Recipe | Web2py Slices - Recipes, Tutorials, Code, Questions

2012-05-17 Thread Michele Comitini
Hi Roberto, No I think not, but I did not investigate the nginx <-> scgi side of the connection much. I am referring to the "Connection: keep-alive" in browser<->nginx dialog, the answer before was always "Connection: close" from nginx, so the client browser had to reopen the connection to nginx

Re: [web2py] Re: web2py uWSGI cherokee -- I give up

2012-05-17 Thread Vasile Ermicioi
I still think that for you best of all is to use uwsgi without nginx - simpler setup, less layers, I use it and I can't say that it is less performant then nginx+uwsgi my webfaction setup - web2py folder is in /home/myuser/web2py - myuser and myport are my webfaction user and wget http://project

Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Sebastian E. Ovide
As I pass it as vars via LOAD: {{=LOAD('default', 'send_suggestion', vars={ 'c':request.controller, 'f':request.function, 'args':request.args, 'vars':request.vars}, ajax_trap=True)}} does it mean that request.vars has not been serialized/de

[web2py] Re: Table/grid with checkboxes for selecting records?

2012-05-17 Thread yazan marei
http://www.hymarkets.com/servlet/track?campaignid=701_d000l_gg9&utm_landingpageid=en_2029&utm_source=affiliate&utm_campaign=yazan_marei&utm_papaffiliateid=cab7eebf&a_aid=cab7eebf&utm_medium=affiliate بتاريخ السبت، 12 مايو، 2012 UTC+4 2:13:27 ص، كتب Brian M: > > How can I create a table/grid

Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Anthony
> > As I pass it as vars via LOAD: > > {{=LOAD('default', > 'send_suggestion', > vars={ 'c':request.controller, > 'f':request.function, > 'args':request.args, > 'vars':request.vars}, > ajax_trap=True)}} > > does it mean that request.vars h

[web2py] web2py back reference and compute fields problem

2012-05-17 Thread bioform
Hello. I have two models: "order (fields: id,cost)" and "order_item (fields: id, order, price, quantity)". "order_item.order" looks like: Field('order', db.order) i'll try to add "total_price" field to "order" table: Field('total_price', 'integer' ,compute=lambda row: calc(row)) where "calc(ro

[web2py] url rewrite for a multilingual / international site

2012-05-17 Thread yus
I am using web2py for a multilingual web-site with. I want to manage language setting the same way that it is managed in the admin application (that is through session and cookies I guess), but at the sale time I want the language to be explicitly indicated on the url structure as

[web2py] url rewrite for a multilingual / international site and search engine visibility

2012-05-17 Thread yus
I am using web2py for a multilingual web-site with. I want to manage language setting the same way that it is managed in the admin application (that is through session and cookies I guess), but at the sale time I want the language to be explicitly indicated on the url structure as mysi

[web2py] Re: Multi computed fields

2012-05-17 Thread Niphlod
The onsuccess parameter of form.process() seems to cover your problems: from http://web2py.com/books/default/chapter/29/7 """ onsuccess and onfailure can be functions like lambda form: do_something(form) """ Il giorno giovedì 17 maggio 2012 10:35:46 UTC+2, Gabriella Canavesi ha scritto: > >

[web2py] Re: url rewrite for a multilingual / international site and search engine visibility

2012-05-17 Thread csantos
Yes, but there's a bug associated with this feature in the latest release. For more info, check this out: http://code.google.com/p/web2py/issues/detail?id=798&sort=-id On Thursday, May 17, 2012 9:21:30 AM UTC-3, yus wrote: > > I am using web2py for a multilingual web-site with. > > I want to ma

[web2py] Re: web2py back reference and compute fields problem

2012-05-17 Thread Ross Peoples
I don't know about the "order.order_item.select()" part. Have you tried debugging the "calc" method? Insert this line right above "result = 0": import pdb; pdb.set_trace() Run the app from the console (i.e: python web2py.py -a password ...) and when the method gets called, the application should

Re: [web2py] url rewrite for a multilingual / international site and search engine visibility

2012-05-17 Thread Jonathan Lundell
On May 17, 2012, at 5:21 AM, yus wrote: > I am using web2py for a multilingual web-site with. > > I want to manage language setting the same way that it is managed in the > admin application (that is through session and cookies I guess), but at the > sale time I want the language to be explicitl

Re: [web2py] Re: url rewrite for a multilingual / international site and search engine visibility

2012-05-17 Thread Jonathan Lundell
On May 17, 2012, at 6:20 AM, csantos wrote: > Yes, but there's a bug associated with this feature in the latest release. > For more info, check this out: > http://code.google.com/p/web2py/issues/detail?id=798&sort=-id BTW, that issues says: > For instance, the URL "/myapp/static/images/poweredb

[web2py] Re: RFC: web2py-based workflow engine

2012-05-17 Thread Cliff
Ross, I understand your reasons for attaching approvals to the workflow. I do it the other way because if a deliverable needs approval by six parties, putting six additional steps in the flow makes things a little cluttered. If you add six people as performers of an approval step, does that m

Re: [web2py] Re: plugin_lazy_options_widget trigger event

2012-05-17 Thread Richard Vézina
What to do to not have dependency, I don't like to have autocomplete, but in the pass I didn't find how to avoid of using Suggest Widget. Thanks Richard On Wed, May 16, 2012 at 8:30 PM, kenji4569 wrote: > Hi Jim, > > In puling_suggest_widget, trigger events are invoked from a js file: > > http

Re: [web2py] Re: plugin_lazy_options_widget trigger event

2012-05-17 Thread Jim Steil
Thanks Kenji - I was trying to do this with the default widgets provided by web2py. Thanks for the info though, I will go down this path when I get the time to dig deeper. -Jim On 5/16/2012 7:30 PM, kenji4569 wrote: Hi Jim, In puling_suggest_widget, trigger events are invoked from a js

[web2py] empty classes

2012-05-17 Thread Jonathan Lundell
I noticed, using SQLFORM.grid, that I get occasional empty class attributes, something like foo. I assume that this is a consequence of calls like this one: head.append(TH(header, _class=ui.get('default',''))) It'd be nice, though probably not critical, to fix that, but it's a subtl

[web2py] Re: empty classes

2012-05-17 Thread Massimo Di Pierro
It should be head.append(TH(header, _class=ui.get('default'))) when an attribute is None, it is not displayed. On Thursday, 17 May 2012 09:28:33 UTC-5, Jonathan Lundell wrote: > > I noticed, using SQLFORM.grid, that I get occasional empty class > attributes, something like foo. I assume that t

Re: [web2py] Re: empty classes

2012-05-17 Thread Jonathan Lundell
On May 17, 2012, at 7:51 AM, Massimo Di Pierro wrote: > It should be > > head.append(TH(header, _class=ui.get('default'))) > > when an attribute is None, it is not displayed. That makes sense. > > On Thursday, 17 May 2012 09:28:33 UTC-5, Jonathan Lundell wrote: > I noticed, using SQLFORM.gri

[web2py] Re: web2py back reference and compute fields problem

2012-05-17 Thread Anthony
On Thursday, May 17, 2012 7:46:28 AM UTC-4, bioform wrote: > > Hello. > I have two models: "order (fields: id,cost)" and "order_item (fields: id, > order, price, quantity)". > "order_item.order" looks like: > Field('order', db.order) > > > i'll try to add "total_price" field to "order" table: > Fi

[web2py] Re: Multi computed fields

2012-05-17 Thread Anthony
To get it down to it down to one function, how about: def compute_geoCode(r, component): g = geocoders.Google() place, (lat, lng) = g.geocode(r.name) return eval(component) db.cities.full_address.compute = lambda r: compute_geoCode(r, 'place') db.cities.lat.compute = lambda r: c

[web2py] error in Book: Setting up email

2012-05-17 Thread carlo
Maybe someone else already posted about it but where the Book says: "You need to replace the mail.settings with the proper parameters for your SMTP server. Set mail.settings.login=False if the SMTP server does not require authentication." I think it should be: mail.settings.login=None, because

[web2py] Re: SNI or dedicated IP.

2012-05-17 Thread LightDot
Setting up SNI on Apache is quite straightforward. If anyone has any problems, ask in this thread and I'll try to help. Upside: - dedicated IP isn't needed - it works in all major browsers and OSes Downside: - SNI on Windows XP should work in Firefox, Opera, etc. but not in IE (it will work in

[web2py] Re: Redirect and try except ?

2012-05-17 Thread Anthony
> > How i can use? > > def mycaller(f): > try: return f() > except *(HTTP...)* : return f() > else: raise(HTTP(400)) > How about: def mycaller(f): try: return f() except HTTP: return f() except: raise HTTP(400) Anyway, what exactly are you trying

Re: [web2py] Re: nginx uwsgi error 502 bad gate way

2012-05-17 Thread pbreit
Is it conceivable that a uwsgi + nginx bundle could be produced making python deployment super easy?

Re: [web2py] Re: Multi computed fields

2012-05-17 Thread Paolo
Hi Niphlod, thanks for your answer. Actually, I am looking for something that I can put in my model without touch the code of the forms, e.g., I don't want to change the code of the admin application to solve the problem. Paolo Il 17.05.2012 13:14 Niphlod ha scritto: The onsuccess parameter

Re: [web2py] Re: Multi computed fields

2012-05-17 Thread Paolo
Hi Anthony, thanks for the answer, Your solution is pretty nice but I am still calling it 3 times which actually is the main problem since I am asking 'google' 3 times the same stuff. Is it possible to store the answer somewhere (cache?) the first time and then use the cache copy for the latter

[web2py] Re: RFC: web2py-based workflow engine

2012-05-17 Thread Ross Peoples
On Thursday, May 17, 2012 9:37:46 AM UTC-4, Cliff wrote: > > Ross, > > I understand your reasons for attaching approvals to the workflow. I do > it the other way because if a deliverable needs approval by six parties, > putting six additional steps in the flow makes things a little cluttered.

[web2py] Re: error in Book: Setting up email

2012-05-17 Thread Massimo Di Pierro
Good catch. Fixed in trunk! On Thursday, 17 May 2012 10:16:30 UTC-5, carlo wrote: > > Maybe someone else already posted about it but where the Book says: > > "You need to replace the mail.settings with the proper parameters for your > SMTP server. Set mail.settings.login=False if the SMTP server

Re: [web2py] Re: nginx uwsgi error 502 bad gate way

2012-05-17 Thread Massimo Di Pierro
You mean like a virtual machine? or an installation script? On Thursday, 17 May 2012 10:34:57 UTC-5, pbreit wrote: > > Is it conceivable that a uwsgi + nginx bundle could be produced making > python deployment super easy?

Re: [web2py] Re: Multi computed fields

2012-05-17 Thread Anthony
def compute_geoCode(r, component): g = geocoders.Google() place, (lat, lng) = cache.ram(r.name, lambda: g.geocode(r.name), None) return eval(component) Anthony On Thursday, May 17, 2012 11:44:16 AM UTC-4, Gabriella Canavesi wrote: > > Hi Anthony, thanks for the answer, > Your s

[web2py] Windows binaries version of Python

2012-05-17 Thread Cédric Mayer
Hello all, I'm developping over web2py source (1.99.7) using Eclipse, with Python (I used to use the version 2.7.2, but now because of my problem I use version 2.5.4 but...). When I think my application is worth it, I zip its folder and I give it to someone else in order to test it. This person

[web2py] Re: modules

2012-05-17 Thread Aurigadl
i don't find the error in this code... El miércoles, 16 de mayo de 2012 10:57:15 UTC-5, Aurigadl escribió: > > I did > Thank you for entering Issue > 800 > > > > El miércoles, 16 de mayo de 2012 10:43:36 UTC-5, Massimo Di Pierro > escribió:

Re: [web2py] Re: Multi computed fields

2012-05-17 Thread Anthony
> > Hi Niphlod, thanks for your answer. > Actually, I am looking for something that I can put in my model without > touch the code of the forms, e.g., I don't want to change the code of > the admin application to solve the problem. > In this case, I think caching in the compute_geoCode functio

Re: [web2py] Re: Multi computed fields

2012-05-17 Thread Paolo
This is perfect! Thank you very much Anthony. Paolo Il 17.05.2012 16:47 Anthony ha scritto: def compute_geoCode(r, component): g = geocoders.Google() place, (lat, lng) = cache.ram(r.name, lambda: g.geocode(r.name [9]), None) return eval(component) Anthony On Thursday, May 17, 2012 11:44:16

Re: [web2py] 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Marin Pranjić
I am not sure if I understand your model. Can you explain "tag_link" ? Marin On Thu, May 17, 2012 at 6:28 PM, Jason Brower wrote: > I have the event management tool I have been working on for 2 years now > and I have made some changes to the code that require my most complicated > query to be

Re: [web2py] 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Jason Brower
It is a "many-to-many" but it can link to multiple tables. event is the event that a user can attend table_link is the ID that is used in a particular table. tag is the tag.id that this row is linking to. intent is as described before. tag_type is the table that the system will link to. Notice the

Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Sebastian E. Ovide
thanks for that Anthony I thought that in some automagicaly way web2py was seriallizing/deserializing... ;) by the way as the request.vars.vars contains "" ast.literal_eval(request.vars.vars[9:-1]) did the trick Just wondering if there is an easier way of doing it (I mean: to pass the cu

[web2py] Re: 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Andrew
If another user has a tag that UserA is looking for, then relevance is +2 to UserA If another user is looking for something UserA has, then relevance is +1 to UserA If another user lives in the same city as UserA and has something they are looking for or something to offer then relevance is +1

[web2py] SQL avg()

2012-05-17 Thread Richard Vézina
Hello, How I can make an avg() aggregate with web2py? Richard

[web2py] Re: 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Andrew
"So, is the third similar to the first, but with a city clause. Sounds like it's a +2 if you have something UserA is looking for, but it's only +1 if you live in the same city ? " Oh, I see from your example that it is an *additional* +1 if you are in the same city. Got it.

Re: [web2py] Re: 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Jason Brower
For the third one this is to further show the relevance of a user because they are living near you, but they should be someone that at least has something in common with you. BR, Jason Brower On 05/17/2012 09:22 PM, Andrew wrote: If another user has a tag that UserA is looking for, then relevan

Re: [web2py] Re: 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Carlos Costa
I found a way quite simple but It does not include the Relevance columns. 2012/5/17 Andrew > If another user has a tag that UserA is looking for, then relevance is +2 > to UserA > If another user is looking for something UserA has, then relevance is +1 > to UserA > If another user lives in the s

Re: [web2py] Re: 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Jason Brower
On 05/17/2012 09:29 PM, Andrew wrote: "So, is the third similar to the first, but with a city clause. Sounds like it's a +2 if you have something UserA is looking for, but it's only +1 if you live in the same city ? " Oh, I see from your example that it is an _additional_ +1 if you are in th

Re: [web2py] SQL avg()

2012-05-17 Thread Jim Steil
I see sum, min, and max aggregates in the book at section 6.24.4, but no avg. But, using sum and count (from 6.21.3) you could get there. -Jim On 5/17/2012 1:25 PM, Richard Vézina wrote: Hello, How I can make an avg() aggregate with web2py? Richard

Re: [web2py] Re: 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Jason Brower
The relevance columns are vital as I need to know how strong the relation is to UserA. It's used in a tag cloud module that I have built. BR, Jason On 05/17/2012 09:30 PM, Carlos Costa wrote: I found a way quite simple but It does not include the Relevance columns. 2012/5/17 Andrew mailto:awil

Re: [web2py] SQL avg()

2012-05-17 Thread Richard Vézina
Yeah, that's what I thought just after press send :) Richard On Thu, May 17, 2012 at 2:33 PM, Jim Steil wrote: > I see sum, min, and max aggregates in the book at section 6.24.4, but no > avg. But, using sum and count (from 6.21.3) you could get there. > >-Jim > > > On 5/17/2012 1:25 PM, R

Re: [web2py] SQL avg()

2012-05-17 Thread Richard Vézina
print db().select(db.tab1.f2.sum()/db.tab1.f2.count(), groupby=db.tab1.f1) Richard On Thu, May 17, 2012 at 2:38 PM, Richard Vézina wrote: > Yeah, that's what I thought just after press send :) > > Richard > > > On Thu, May 17, 2012 at 2:33 PM, Jim Steil wrote: > >> I see sum, min, and max aggr

Re: [web2py] SQL avg()

2012-05-17 Thread Richard Vézina
Now I am searching a way to sum a list:reference type field with the proper representation of id... Richard On Thu, May 17, 2012 at 2:54 PM, Richard Vézina wrote: > print db().select(db.tab1.f2.sum()/db.tab1.f2.count(), groupby=db.tab1.f1) > > Richard > > > On Thu, May 17, 2012 at 2:38 PM, Rich

[web2py] Re: Load data from sqlite file?

2012-05-17 Thread Dave
Yes, that's exactly what i need to do. I was going to try it like you described using the filename to create a new DAL, and defining it as an import function somewhere in the model, so glad to hear that it should be doable! Will post my code once i have I get around to writing it. Thanks, Dav

Re: [web2py] SQL avg()

2012-05-17 Thread Jim Steil
I just hacked a quick and dirty solution by inserting the following to dal.py at line 7370: def avg(self): return Expression(self.db, self.db._adapter.AGGREGATE, self, 'AVG', self.type) Worked fine on my tests with MySQL, using it just like sum, but using avg instead. -Jim

Re: [web2py] SQL avg()

2012-05-17 Thread Richard Vézina
Maybe open a ticket and propose a patch!! Richard On Thu, May 17, 2012 at 3:09 PM, Jim Steil wrote: > I just hacked a quick and dirty solution by inserting the following to > dal.py at line 7370: > > def avg(self): > return Expression(self.db, self.db._adapter.AGGREGATE, self, > 'A

Re: [web2py] 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Marin Pranjić
and why both tag and tag_link have an event.id field? is this redundant? On Thu, May 17, 2012 at 7:56 PM, Jason Brower wrote: > It is a "many-to-many" but it can link to multiple tables. > event is the event that a user can attend > table_link is the ID that is used in a particular table. > tag

Re: [web2py] SQL avg()

2012-05-17 Thread Jim Steil
Done http://code.google.com/p/web2py/issues/detail?id=803 -Jim On 5/17/2012 2:27 PM, Richard Vézina wrote: Maybe open a ticket and propose a patch!! Richard On Thu, May 17, 2012 at 3:09 PM, Jim Steil > wrote: I just hacked a quick and dirty solution by insertin

Re: [web2py] Re: SNI or dedicated IP.

2012-05-17 Thread Michele Comitini
SNI does not work with Android 2.x browser and also any other application using the unfortunate java api implementation. They were in a hurry and just put something that "worked" on ssl but without SNI support even if SNI standard was out since long before... mic 2012/5/17 LightDot : > Setting u

Re: [web2py] nginx uwsgi error 502 bad gate way

2012-05-17 Thread Marco Tulio Cicero de M. Porto
Hi! Not sure if it's your case. I had a similar problem, asked around and Bruce Wade told me that there were a few changes on uwsgi on ubuntu, so he changed the installation script a bit and posted it on the list. The link is: https://groups.google.com/forum/#!searchin/web2py/nginx$20update/web2

[web2py] Re: RFC: web2py-based workflow engine

2012-05-17 Thread Cliff
Let's inject manufacturing into the order processing scenario you were using before. It's a three step process. Step one fabricates widgets. Step 2 attaches the widgets to widget bicarackets, purchased from another vendor. Step 3 packages the assemblies for shipment. If the last batch of wi

Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Anthony
> > by the way as the request.vars.vars contains " 'www': '4'}>" ast.literal_eval(request.vars.vars[9:-1]) did the trick > Sorry, I was thinking dict instead of Storage. > Just wondering if there is an easier way of doing it (I mean: to pass > the current URL+vars to the LOAD) > How abou

Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Anthony
Even better, just put the URL in a hidden field in the form: {{=LOAD('default', 'send_suggestion', ajax_trap=True)}} def send_suggestion(): form = SQLFORM.factory(Field('message', 'text', requires=IS_NOT_EMPTY ()), hidden=dict(url=XML(URL(args=request.args, vars=request.get_vars

[web2py] Routing help

2012-05-17 Thread Alexander McLin
Hello, I'm new to web2py and am having a difficult time understanding how to use either the parameter or pattern based systems as well how web2py default routing works. *I'll start off with the first point of confusion for me;* The web2py book and documentation has led me to believe that the f

Re: [web2py] Re: Single error message for radio group

2012-05-17 Thread Michael Brooks
I can't find any documentation of the hideerror feature, but looking at html.py, I don't see how the above example would work: INPUT( _type='radio', _name='age', _value='5', _id='age5', hideerror=True,value =self.request.vars['age']) The hideerror flag seems to work if you do this, though: inp

[web2py] list:reference shouldn't return list of lists in case of aggregates?

2012-05-17 Thread Richard Vézina
Hello, I don't know if this has be fixed since 1.99.4, but I can't aggregates a table if a list:reference field is present in the requested fields. db().select(db.tab1.f2.sum()/db.tab1.f2.count(), db.tab1.f3_list-reference.sum(), groupby=db.tab1.f4) give error... Ok, here I think that ok since th

[web2py] Re: RFC: web2py-based workflow engine

2012-05-17 Thread Ross Peoples
On Thursday, May 17, 2012 3:54:44 PM UTC-4, Cliff wrote: > > Let's inject manufacturing into the order processing scenario you were > using before. It's a three step process. Step one fabricates widgets. > Step 2 attaches the widgets to widget bicarackets, purchased from another > vendor.

[web2py] Re: modules

2012-05-17 Thread Aurigadl
the problem was caused because the file is not created __ init__ in the first folder of the project. / myapp / __init__.py why not this file is always created automatically? .. El jueves, 17 de mayo de 2012 12:14:21 UTC-5, Aurigadl escribió: > > i don't find the error in this code... > > El mi

[web2py] Re: Routing help

2012-05-17 Thread pbreit
I believe to hide 'default' and 'index' you need to use routes.py and: routers = dict( # base router BASE = dict( default_application = 'init', default_controller = 'default', default_function = 'index', ), ) Setting the default application will hide it as wel

Re: [web2py] Re: Single error message for radio group

2012-05-17 Thread Anthony
> > I can't find any documentation of the hideerror feature, but looking at > html.py, I don't see how the above example would work: > > INPUT( _type='radio', _name='age', _value='5', _id='age5', > hideerror=True,value > =self.request.vars['age']) > That should work. Note, INPUT inherits from D

[web2py] Re: Windows binaries version of Python

2012-05-17 Thread Derek
1. Use "Pack All". It creates a W2P file that you can send. The production site would use the "upload and install packed..." 2. I believe it's developed on 2.7.x - when it says it supports 2.5.x that means it is backwards compatible to that version. No idea what the binary version is - I prefer

[web2py] Re: modules

2012-05-17 Thread Derek
It should be created automatically. I see it when I go through the wizard and when I create a new simple app. On Thursday, May 17, 2012 2:19:27 PM UTC-7, Aurigadl wrote: > > the problem was caused because the file is not created __ init__ in the > first folder of the project. > > / myapp / __ini

[web2py] Re: Routing help

2012-05-17 Thread pbreit
Oh, I see, that's how you code the REST stuff. My bad.

[web2py] Re: require login on submit

2012-05-17 Thread Pystar
Try this: #Controller## def status_checker(): if auth.is_logged_in(): pass else: redirect(URL(f="user", args="login")) form = SQLFORM(db.blah) if form.accepts(request.vars, session, onvalidation=status_checker): redirect(URL("index")) On Wednesday, May

[web2py] Re: Routing help

2012-05-17 Thread Anthony
> > The web2py book and documentation has led me to believe that the following > would work; > > http://120.0.0.1/myapp/default/somefunction can be written as > http://120.0.0.1/myapp/somefunction but I get invalid request error > Here's what the book says: web2py maps a URL of the form: 1.

[web2py] Re: change the size of a text field in a form

2012-05-17 Thread Pystar
I would suggest you using custom forms in your view and targeting the attribute you wish to change with CSS. I find that approach more flexible. In the view: {{=form.custom.begin}} ###you can include normal HTML here to build up the form elements and target it with CSS or {{=form.custom.end}}

[web2py] Re: require login on submit

2012-05-17 Thread Anthony
> > if form.accepts(request.vars, session, onvalidation=status_checker): > redirect(URL("index")) > This would not be a good user experience. A user who isn't logged in would fill out and submit the form, and upon submission they would end up being redirected to the login page, but their fo

[web2py] Re: require login on submit

2012-05-17 Thread Pystar
I agree with you. That was a quick and dirty solution. If you really want your user case and also want a good UX experience for the unlogged in user, you can consider using some JQuery, maybe .focus() on the first field of the form to trigger some the login function. This would save the un-logge

[web2py] Re: RFC: web2py-based workflow engine

2012-05-17 Thread Derek
I think you are just using abstract examples, though workflows are more than just creating a widget or approving invoices. The standard for workflow support is here: http://www.workflowpatterns.com/ (look here for a tidy list of workflow types... http://www.workflowpatterns.com/evaluations/ope

Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Sebastian E. Ovide
I like that ! On Thu, May 17, 2012 at 9:10 PM, Anthony wrote: > Even better, just put the URL in a hidden field in the form: > > {{=LOAD('default', 'send_suggestion', ajax_trap=True)}} > > def send_suggestion(): > form = SQLFORM.factory(Field('message', 'text', requires=IS_NOT_EMPTY > ()), >

Re: [web2py] list:reference shouldn't return list of lists in case of aggregates?

2012-05-17 Thread Massimo Di Pierro
This is not possible because the database does not support it. Lists are not even stored as lists, they are stored as strings. On Thursday, 17 May 2012 16:13:50 UTC-5, Richard wrote: > > Hello, > > I don't know if this has be fixed since 1.99.4, but I can't aggregates a > table if a list:referen

[web2py] Re: Windows binaries version of Python

2012-05-17 Thread Massimo Di Pierro
It is possible that different python version use different sqlite formats. If you develop with 2.5 and pack and unpack to 2.7 the sqlite file will be readable. I do not know for sure about the opposite. massimo On Thursday, 17 May 2012 16:40:07 UTC-5, Derek wrote: > > 1. Use "Pack All". It crea

[web2py] Re: modules

2012-05-17 Thread Massimo Di Pierro
When you make a new app, web2py unpacks welcome.w2p. welcome.w2p is an image of the welcome app when web2py was installed or upgraded. Any new installation of web2py should include __init__.py in welcome.w2p but it is possible that you have deleted it and triggered the creation of a new welcom

Re: [web2py] list:reference shouldn't return list of lists in case of aggregates?

2012-05-17 Thread Richard Vézina
On retrieve only? Richard On Thu, May 17, 2012 at 7:03 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > This is not possible because the database does not support it. Lists are > not even stored as lists, they are stored as strings. > > > On Thursday, 17 May 2012 16:13:50 UTC-5, Rich

[web2py] MongoDb Adapter issues

2012-05-17 Thread Krzysztof Mulica
Hello, I'm having issues with the mongo adapter doing selects (using latest code from git.) The initial issue i ran into was not being able to import SON in dal.py (i changed from pymongo to from bson and that fixed that) After that I ran into issues with pymongo.objectid, after a little resear

[web2py] Re: MongoDb Adapter issues

2012-05-17 Thread Massimo Di Pierro
Did you apply your changes to the latest trunk. If so, could you post your changes. We will review them and probably incorporate them. massimo On Thursday, 17 May 2012 19:46:00 UTC-5, Krzysztof Mulica wrote: > > Hello, > I'm having issues with the mongo adapter doing selects (using latest code

Re: [web2py] 75€ BOUNTY - Massively Complicated Query Required

2012-05-17 Thread Jason Brower
Yes, it can be redundant. Ignore it if you like. BR, Jason On 05/17/2012 10:32 PM, Marin Pranjić wrote: and why both tag and tag_link have an event.id field? is this redundant? On Thu, May 17, 2012 at 7:56 PM, Jason Brower > wrote: It is a "ma

[web2py] Re: MongoDb Adapter issues

2012-05-17 Thread Massimo Di Pierro
I will wait when you are done than... when you think this should be included, perhaps it will be easier to upload the dal.py as an issue in google code so I will not miss it. On Thursday, 17 May 2012 21:06:46 UTC-5, Krzysztof Mulica wrote: > > Yes latest trunk, but i'm working through a few more

Re: [web2py] web2py free cookbook raffle

2012-05-17 Thread Jason Brower
On 05/18/2012 06:41 AM, Massimo Di Pierro wrote: http://web2py.com/cookbook Woot, thanks!