[web2py] Re: @reboot task started twice when a init simbolink link is present

2011-12-02 Thread dsanchez
Done. Ticket 548. Thanks On Dec 1, 5:49 am, Massimo Di Pierro wrote: > Please submit a ticket about this. Althought I am not sure how to fix > this because web2py will think you have two apps. > > On Nov 30, 4:54 am, dsanchez wrote: > > > > > > > > > Hello all > > > I have the following crontab

[web2py] Re: sqlform: vars don't work

2011-12-02 Thread puercoespin
No field 'list:integer'. I never programmed a db with field 'list:integer'. Deleting all database folder, (a lot of times) don't resolve the problem.

[web2py] Re: sqlform: vars don't work

2011-12-02 Thread puercoespin
Sorry, i dont attach a def in my firt post: def buscar_coche_ocasion(): query=(db.coche_ocasion.marca == request.args(0)) & (db.coche_ocasion.modelo==request.args(1)) if request.vars.potencia !='Todos': query &= db.coche_ocasion.potencia >= request.vars.potencia listado_coch

[web2py] Re: Best practices: When to use classes

2011-12-02 Thread kenji4569
I think there are two types of web applications; one is for admin- site, and the other is for front-site. For admin-site, CPU-usage would be relatively not so critical, and rich man's programming (fat models in web2py) could be allowed. Front-site, on the other hand, needs optimization as far as po

[web2py] Re: Hot to do the: Remember me (for 30 days) by default?

2011-12-02 Thread Alan Etkin
In this thread Massimo covers the user session administration. http://groups.google.com/group/web2py/browse_thread/thread/ab2ace730fd85578/d7ca6ed70b1a4d4c Have you tried setting a long (in seconds) auth.settings.expiration value? On Dec 2, 2:04 am, Constantine Vasil wrote: > Thank you. Actually

[web2py] Re: Default field value with lambda

2011-12-02 Thread Alan Etkin
The Field class accepts a function as default argument. This should work (i did not test it, mind the actual lambda left side arguments): db.tablename.fieldname.default = lambda r: str(r.id) + "_more_text" On Dec 2, 1:23 am, Matthew wrote: > Is it possible to define a default field value using

[web2py] Re: How to make automatic log-off after 1 hour not several minutes how it is right now?

2011-12-02 Thread Alan Etkin
Try setting auth.settings.expiration with a long integer (like 3600*hours) http://groups.google.com/group/web2py/browse_thread/thread/05a34ff26e75baba/a7713c9a5fe4a544 On Dec 2, 2:14 am, Constantine Vasil wrote: > Automatic log-off goes after several minutes of inactivity - how to make > the use

Re: [web2py] Re: web2py logo and layout has changed one year ago...

2011-12-02 Thread Christopher Steel
PIERRO NOEL lol

[web2py] Re: Set/change modules folder location for an app

2011-12-02 Thread Alan Etkin
The symbolic link approach seems to me to be more interesting than modifying web2py.py, but i do not see why the sys.path.append thing at application code is not recomended. I'll have to search on that topic. Thanks again for the support On Dec 2, 2:04 am, Massimo Di Pierro wrote: > you can crea

[web2py] ttf and fonts

2011-12-02 Thread Rick
Hi, How to use a local font? I put a library with ttf-files inte the static/css directory and write this code in the css file: @font-face { font-style: normal; font-weight: normal font-family: "myfont"; src: url(ttf/DejaVuSans.ttf); } html, body { font:myfont} But it doesn't work.

[web2py] Re: Set/change modules folder location for an app

2011-12-02 Thread Alan Etkin
What do you know... i found this in Stackoverflow, wich covers my question: " ... In any multi-threaded Python program (and not only Python) you should not use os.chdir and you should not change sys.path when you have more than one thread running. It is not safe because it affects other threads. M

[web2py] Re: Set/change modules folder location for an app

2011-12-02 Thread Alan Etkin
Suppose now that i dont feel like changing the web2py.py script because it is something like a framework's specific file. Then i think it would be nice to be able to specify extra system routes to add to the path on web service initialization, in an app specific way. How about an extrapaths file s

[web2py] Re: SQLFORM.grid and query

2011-12-02 Thread peter
Going back to my original problem, Anthony is right. If you define a single filter you have to click 'and' or 'or' to get the filter to be copied into the search. This is easy enough when one knows, but is not exactly intuitive if one does not want to 'and' or 'or' the filter with anything (I recog

[web2py] Re: Speed of JOIN vs Recursive SELECTs

2011-12-02 Thread peter
When I put {{=response.toolbar()}} in my view, the db stats show the db queries, but not their timings, is there something else one has to do to get the timings? Peter On Dec 1, 3:02 pm, Anthony wrote: > Do the db timings differ between first load and subsequent reloading? What > are the times? >

[web2py] Re: joins across databases

2011-12-02 Thread Jim Gregory
What's the easiest way to construct my own rows object from data across two databases? Can I create a class that inherits from the Rows class? Or is there something even simpler? -Jim On Dec 1, 6:15 pm, Vinicius Assef wrote: > I think you have to define 2 db objects. > > 1) Retrieve data from

[web2py] Re: ttf and fonts

2011-12-02 Thread Chris May
It looks like you're going about it fairly well, but I also had issues with particular truetype fonts. Those issues went away after I changed which truetype font I used. This is the code that works for me: @font-face { font-family: myFont; src: url('../static/Qarmic_sans_Abridged.ttf')

[web2py] Re: Default field value with lambda

2011-12-02 Thread Anthony
The default can be a lambda, but I don't think it can take any arguments (e.g., the row or row id), so instead you would probably have to use a computed field. Note, if you also want to be able to write your own values to the computed field, you can do that too -- it only calculates the compute

[web2py] Re: SQLFORM.grid and query

2011-12-02 Thread Anthony
I agree -- it could use some usability improvements. Please open an issue at http://code.google.com/p/web2py/issues/list. On Friday, December 2, 2011 6:48:50 AM UTC-5, peter wrote: > > Going back to my original problem, Anthony is right. If you define a > single filter you have to click 'and' or

[web2py] Re: Decimal vs float

2011-12-02 Thread Cliff
No need. The Python tutorial says mixing integers and decimals in arithmetic is OK. Note version 2.7.1 in the following. cjk@mid-tower:~$ python Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from

[web2py] Registration Using Auth

2011-12-02 Thread lyn2py
Hello, I would like to assign a group on the form where a user registers. For example: Student group Teacher group Admin group Finance group How do I create different registration forms for each user group, so that the users sign themselves up and are assigned the specific group? I'm thinking t

Re: [web2py] Re: Relative path in css for @font-face embedding

2011-12-02 Thread monotasker
It resolves to http://127.0.0.1:8000/topoi/plugin_listandedit/list/notes/static/plugin_framework/fonts/websymbols-regular-webfont.woff This is treating the font url as relative to the full request URL (including arguments), not the app root directory. That's what's confusing me.

Re: [web2py] Re: SQLFORM.grid and query

2011-12-02 Thread Jim Steil
I've already got an issue open on this (http://code.google.com/p/web2py/issues/detail?id=523) and would really like to see it included in the trunk. My proposed change allows you to override the default search capabilities and pass your own search criteria in. You can provide a custom that c

[web2py] Re: Hot to do the: Remember me (for 30 days) by default?

2011-12-02 Thread Anthony
To get rid of the checkbox, set auth.settings.remember_me_form=False. To set the long login, I think it just looks for the existence of request.vars.remember (which would be there if the checkbox were included in the form and checked). So, you should be able to force the long login by adding a

[web2py] Re: How to make automatic log-off after 1 hour not several minutes how it is right now?

2011-12-02 Thread Anthony
The default auth.settings.expiration is 3600, which is an hour. Something must be wrong if login is lasting only a few minutes. Is it possible you have session.forget() somewhere or the session cookie isn't getting sent back from the browser? Anthony On Friday, December 2, 2011 12:14:12 AM UTC

Re: [web2py] Re: Relative path in css for @font-face embedding

2011-12-02 Thread Jonathan Lundell
On Dec 2, 2011, at 7:41 AM, monotasker wrote: > It resolves to > http://127.0.0.1:8000/topoi/plugin_listandedit/list/notes/static/plugin_framework/fonts/websymbols-regular-webfont.woff > > This is treating the font url as relative to the full request URL (including > arguments), not the app roo

[web2py] Re: Speed of JOIN vs Recursive SELECTs

2011-12-02 Thread Anthony
On Friday, December 2, 2011 6:57:32 AM UTC-5, peter wrote: > > When I put {{=response.toolbar()}} in my view, the db stats show the > db queries, but not their timings, is there something else one has to > do to get the timings? db stats should reveal a 2-column table -- first column is the query

Re: [web2py] Re: Relative path in css for @font-face embedding

2011-12-02 Thread Anthony
I thought CSS files interpreted relative URLs relative to the CSS file itself, not the page in which it was loaded. If the CSS file is in /static/css and the font is in /static/plugin_framework/fonts, maybe src: url(../plugin_framework/fonts/websymbols-regular-webfont.woff) will work. Anthony

[web2py] SQLFORM grid

2011-12-02 Thread peter
I am having the following problem when I use 'edit' on SQLFORM grid, and then submit the changes. I tried downloading the latest trunk and also created the app afresh to ensure things were otherwise clean 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. Traceback (most recent call las

[web2py] Re: SQLFORM grid

2011-12-02 Thread peter
I have discovered that the error only occurs when one is editing records that are returned from a query

[web2py] Re: install packed application which uses sqlite

2011-12-02 Thread Carlos Hanson
Thanks. I will test that today.

[web2py] Re: overriding Auth functions

2011-12-02 Thread Carlos Hanson
That, Sir, is an excellent question. It seems silly that I didn't think of that, especially when I am looking a request.args. :-) I thought I found an example that had the format I chose, but I can't find one. I just think my brain didn't make the right connection. Thanks for pointing it out.

[web2py] Re: How to make automatic log-off after 1 hour not several minutes how it is right now?

2011-12-02 Thread Constantine Vasil
session.forget() - no - everything is by default. If there is an inactivity it logs off.

[web2py] Re: Hot to do the: Remember me (for 30 days) by default?

2011-12-02 Thread Constantine Vasil
Thank you, Anthony! I will check it out.

[web2py] Re: JQuery Mobile + web2py - how to set data-url attribute dynamically?

2011-12-02 Thread Constantine Vasil
new_url - it is a variable send to the page like form=form

[web2py] Can we have a register decorator?

2011-12-02 Thread Constantine Vasil
I need the following functionality - I want to send invitations via emails which include a link with a code - like /invite/123456. invite function has a decorator for login. Because for my app to go viral the sign up process needs to be real quick. In this case the first form I need is to show t

Re: [web2py] Re: Relative path in css for @font-face embedding

2011-12-02 Thread Jonathan Lundell
On Dec 2, 2011, at 8:28 AM, Anthony wrote: > I thought CSS files interpreted relative URLs relative to the CSS file > itself, not the page in which it was loaded. If the CSS file is in > /static/css and the font is in /static/plugin_framework/fonts, maybe src: > url(../plugin_framework/fonts/we

[web2py] Re: Can we have a register decorator?

2011-12-02 Thread Anthony
What does the invite function do? Why is there a login decorator on it? Can't you just remove the login decorator, and then have the function return (or redirect to) a registration form? On Friday, December 2, 2011 12:12:06 PM UTC-5, Constantine Vasil wrote: > > I need the following functionalit

[web2py] Re: JQuery Mobile + web2py - how to set data-url attribute dynamically?

2011-12-02 Thread Anthony
So what's the problem? What does your view look like, and what is in the resulting html? Have you confirmed that new_url actually has a value? On Friday, December 2, 2011 12:06:18 PM UTC-5, Constantine Vasil wrote: > > new_url - it is a variable send to the page like form=form >

[web2py] Re: How to make automatic log-off after 1 hour not several minutes how it is right now?

2011-12-02 Thread Anthony
Can you confirm that the session cookie is being sent back (via browser developer tools)? Check the session and make sure auth.expires is in there. On Friday, December 2, 2011 12:03:28 PM UTC-5, Constantine Vasil wrote: > > session.forget() - no - everything is by default. If there is an > ina

[web2py] Re: SQLFORM grid

2011-12-02 Thread Anthony
Please submit an issue: http://code.google.com/p/web2py/issues/list On Friday, December 2, 2011 11:35:01 AM UTC-5, peter wrote: > > I have discovered that the error only occurs when one is editing records > that are returned from a query

[web2py] Re: Post-login redirection issues

2011-12-02 Thread Anthony
On Friday, December 2, 2011 12:09:25 AM UTC-5, Yarin wrote: > > I think the duality of this behavior is confusing and inconsistent: > a) It would make more sense for all post-login behavior to follow the > same set of rules. > b) The default post-login behavior should in all cases be to redirect >

[web2py] connection with oracle database

2011-12-02 Thread tOlorun
Thanks for the other time ... buh iam back again ... i dont seem to get a hang of connection strings (lols) please kindly help me with the error below ... Traceback (most recent call last): File "gluon/restricted.py", line 194, in restricted File "E:/tOlorun/web2py/web2py/applications/est8m

[web2py] Re: connection with oracle database

2011-12-02 Thread Lazarof
Hi! Have you tried this? export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/ server/ export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$PATH sudo apt-get install python-dev python-setuptools sudo -E easy_install cx_Oracle Test: $ python >>> import cx_Oracle >>> c

[web2py] Re: Best practices: When to use classes

2011-12-02 Thread Lazarof
Optimize your web2py app using the new import method http://martin.tecnodoc.com.ar/default/post/2011/09/12/7_optimize-your-web2py-app-using-the-new-import-method On Dec 2, 2:53 pm, kenji4569 wrote: > I think there are two types of web applications; one is for admin- > site, and the other is for

[web2py] Re: JQuery Mobile + web2py - how to set data-url attribute dynamically?

2011-12-02 Thread Constantine Vasil
no - the new_url actually has not a a value.

[web2py] Ulipad with web2py plugin

2011-12-02 Thread chandrakant kumar
Has anybody used ulipad with web2py plugin? I am trying it and it looks good.

Re: [web2py] Re: Best practices: When to use classes

2011-12-02 Thread pbreit
I'm interested in this approach and these samples are very helpful but it seems like there is still a ways to go. Would it be possible to create some sort of welcome-like model-less bootstrap?

[web2py] Re: One Queue

2011-12-02 Thread howesc
if you are on GAE you can use the taskqueue. i also use amazon's SQS for cross-application queue handling.

[web2py] Re: How send multiple email messages with GAE deferred.defer?

2011-12-02 Thread howesc
looks like send_email_message is a function object which is not pickleable. i do a crap-ton of: taskqueue.add(url=URL(r=request, ...), params={...}) i think many-moons ago i tried with no luck to use the deferred library and gave up. taskque.add is so much more clear to me. anyhow,

Re: [web2py] Re: connection with oracle database

2011-12-02 Thread tOlorun
Thanks i am able to connect python to oracle database but iam talking about connecting using the web2py connection string db = DAL('oracle://schema_name/schema_password@tns_name', pool_size=100) to connect to oracle database thanks On 12/2/11, Lazarof wrote: > Hi! > Have you tried this? > >

[web2py] Re: Default field value with lambda

2011-12-02 Thread Matthew
I did try with a computed field, but it did not work. It kept giving None as the value. Here is what I've tried so far: Field('name', compute=lambda r: 'Node ' + r['id'] or 'Node'), and Field('name', default=lambda r: 'Node ' + r['id'] or 'Node'), I understand that *default* does not take

Re: [web2py] Re: Best practices: When to use classes

2011-12-02 Thread Richard Vézina
Pretty much interrested too... I would start with menu.py since I use conditional group menu. What do I have to do... Richard On Fri, Dec 2, 2011 at 2:46 PM, pbreit wrote: > I'm interested in this approach and these samples are very helpful but it > seems like there is still a ways to go. Woul

[web2py] How to make a simple upload form with just one field - a file name?

2011-12-02 Thread Constantine Vasil
How to make a simple upload form with just one field - a file name? In GAE there is not a file system so I want to store this CSV file in a string to process it. Thank you!

Re: [web2py] Re: Best practices: When to use classes

2011-12-02 Thread Bruno Rocha
On Fri, Dec 2, 2011 at 5:46 PM, pbreit wrote: > I'm interested in this approach and these samples are very helpful but it > seems like there is still a ways to go. Would it be possible to create some > sort of welcome-like model-less bootstrap? Look in to my modules here: https://github.com/roc

[web2py] How to implement a simple invitation system for new and existing users?

2011-12-02 Thread Constantine Vasil
I have a list of email addresses and want to send invitation emails for a group membership to them. When the user clicks on the link in the email the system would not know in advance if he is an existing user or a new user, also in the email list the user can be invited with one email address bu

[web2py] Re: 'id' on 1.99.3 with SQLFORM.grid and links

2011-12-02 Thread David Watson
Thanks for your response. On Dec 1, 1:20 pm, Anthony wrote: > Does your query/grid include the 'id' field? Yes. Did the same code used to work > on 1.99.2? No.

[web2py] Re: Default field value with lambda

2011-12-02 Thread Anthony
On Friday, December 2, 2011 2:57:07 PM UTC-5, Matthew wrote: > > I did try with a computed field, but it did not work. It kept giving None > as the value. Here is what I've tried so far: > > Field('name', compute=lambda r: 'Node ' + r['id'] or 'Node'), > That should yield an error -- can't conc

[web2py] Re: [ login | register | lost password? ]

2011-12-02 Thread monotasker
Any idea when this will show up in stable?

[web2py] Re: Wizard builder

2011-12-02 Thread bluemoth
@Alan, thanks, I did think about subclassing FORM which would build of existing code. @Anthony, thanks, Power Form Wizard looks like a start to what I'm wanting. However, it's not clear if you can build forms without using database structures. I can't imagine it would be difficult to change to bui

[web2py] Re: [ login | register | lost password? ]

2011-12-02 Thread Anthony
I believe 1.99.3 will be out any day now (includes both of the changes to auth.navbar mentioned in this thread). On Friday, December 2, 2011 4:09:50 PM UTC-5, monotasker wrote: > > Any idea when this will show up in stable? >

[web2py] Re: Post-login redirection issues

2011-12-02 Thread Anthony
> > On Friday, December 2, 2011 12:09:25 AM UTC-5, Yarin wrote: >> >> I think the duality of this behavior is confusing and inconsistent: >> a) It would make more sense for all post-login behavior to follow the >> same set of rules. >> b) The default post-login behavior should in all cases be to r

[web2py] Re: Set/change modules folder location for an app

2011-12-02 Thread Massimo Di Pierro
You can do it in routes.py import sys sys.path.append(...) that file is executed only once. On Dec 2, 5:47 am, Alan Etkin wrote: > Suppose now that i dont feel like changing the web2py.py script > because it is something like a framework's specific file. Then i think > it would be nice to be ab

[web2py] Re: Registration Using Auth

2011-12-02 Thread Massimo Di Pierro
def register_in_group(): group_id = request.args(0) auth.settings.register_onaccept=lambda form: auth.add_membership(group_id,form.vars.id) form = auth.register() return dict(form=form) then call http://.../register_in_group/2 On Dec 2, 9:24 am, lyn2py wrote: > Hello, > > I wou

[web2py] Re: connection with oracle database

2011-12-02 Thread Lazarof
did you ... import cx_Oracle On Dec 2, 11:56 pm, tOlorun wrote: > Thanks > > i am able to connect python to oracle database > > but iam talking about connecting using the web2py connection string > > db = DAL('oracle://schema_name/schema_password@tns_name', pool_size=100) > > to connect to orac

[web2py] Re: Ulipad with web2py plugin

2011-12-02 Thread Massimo Di Pierro
Can you post a link? On Dec 2, 1:44 pm, chandrakant kumar wrote: > Has anybody used ulipad with web2py plugin? I am trying it and it looks > good.

[web2py] Re: How send multiple email messages with GAE deferred.defer?

2011-12-02 Thread Constantine Vasil
I used exclusively deferred when the project was under GAE+Django - no issue with pickle - worked like charm. There is something fundamental with web2py which is different.

[web2py] Re: How to implement a simple invitation system for new and existing users?

2011-12-02 Thread Massimo Di Pierro
something like: db.define_table('invite',Field('email'),Field('uuid',default=str(uuid.uuid4( auth.settings.extra_fields['auth_user']=Field('uuid',requires=IS_IN_DB(db,db.invite.uuid))) auth.settings.register_onaccept: lambda form: db(db.invite.uuid==form.vars.uuid).delete() auth.define_tables(

[web2py] Re: 'id' on 1.99.3 with SQLFORM.grid and links

2011-12-02 Thread Massimo Di Pierro
can we see the entire code for the action On Dec 1, 12:13 pm, David Watson wrote: > I am running web2py version 1.99.3 > > I have the following code in my default controller. The view shows the > item. When i run >   links = [lambda row: > A('Edit',_href=URL("default","sweeps",args=[row.id])), >

[web2py] Re: connection with oracle database

2011-12-02 Thread Lazarof
If you are working with Oracle google for this - Oracle Apex. On Dec 2, 11:56 pm, tOlorun wrote: > Thanks > > i am able to connect python to oracle database > > but iam talking about connecting using the web2py connection string > > db = DAL('oracle://schema_name/schema_password@tns_name', pool_s

[web2py] Re: SQLTABLE images for id fields

2011-12-02 Thread Anthony
Note, you can create any arbitrary link (or whatever) in the id column (or any column) of a SQLTABLE by defining the 'represent' attribute of the 'id' field: db.mytable.id.represent = lambda id, row: A(IMG(_src=URL('static', 'myimage.png')), _href=URL('default', 'view', args=['mytable', id]

Re: [web2py] Re: Ulipad with web2py plugin

2011-12-02 Thread chandrakant kumar
http://code.google.com/p/ulipad/

[web2py] Re: Do you compile app ?

2011-12-02 Thread Plumo
would be neat if the app auto-recompiled when changes were detected. I also often forget.

[web2py] Re: Do you compile app ?

2011-12-02 Thread Massimo Di Pierro
That's a good idea. Please open an issue so the idea does not get lost On Dec 2, 9:15 pm, Plumo wrote: > would be neat if the app auto-recompiled when changes were detected. I also > often forget.

[web2py] Re: Registration Using Auth

2011-12-02 Thread lyn2py
Thanks Massimo! On Dec 3, 5:53 am, Massimo Di Pierro wrote: > def register_in_group(): >     group_id = request.args(0) >     auth.settings.register_onaccept=lambda form: > auth.add_membership(group_id,form.vars.id) >     form = auth.register() >     return dict(form=form) > > then call > > http:

[web2py] Create a "New Simple Application" clarification

2011-12-02 Thread lyn2py
I remember reading somewhere that creating a new application will clone the "welcome" app, I wonder if it's true? I want to confirm this because I downloaded the trunk version (I was previously using the stable version), and copied over the "old" welcome app (the "new" welcome app was renamed to w

[web2py] web2py for dummies

2011-12-02 Thread Andrea Bravi
Hi everyone, first of all, thank you for the really nice job done with web2py: as soon as I downloaded it, I really liked how easy it is to use the admin interface and play with it! That being said, I would like to kindly ask you some advices regarding how to learn using web2py. I have a bac

[web2py] Re: web2py for dummies

2011-12-02 Thread Massimo Di Pierro
You raise a good issue. We will start working on it as soon as the 4th ed of the book is out. On Dec 3, 12:17 am, Andrea Bravi wrote: > Hi everyone, > > first of all, thank you for the really nice job done with web2py: as soon > as I downloaded it, I really liked how easy it is to use the admin >

Re: [web2py] Create a "New Simple Application" clarification

2011-12-02 Thread Kenneth Lundström
If I remember correctly the wizard does not make a copy of the applications/welcome folder. Instead it uses the welcome.w2p file found in the root folder of your web2py installation. Kenneth I remember reading somewhere that creating a new application will clone the "welcome" app, I wonder i

[web2py] Re: Create a "New Simple Application" clarification

2011-12-02 Thread Massimo Di Pierro
when you install or upgrade web2py zip the welcome app into a welcome.w2p and uses this file from that moment on. If you make changes to the welcome app and you want to use them as scaffolding, you must delete the welcome.w2p file so that wep2py will make a new one. This will break every time you u