Re: [web2py] Re: Webfaction: Memory usage way over your limit ; again.

2011-11-27 Thread Roberto De Ioris
and also uwsgi --version doesn't give the version but tells that there is an error This could only be generated by a wrong compiled-binary (maybe a make without a make clean after some config changes). --version triggers only a fprintf() on a fixed binary blob, so if it fails something

[web2py] How to check a value in a dictionary entry in template?

2011-11-27 Thread Constantine Vasil
I am passing a dictionary to template. Each dictionary value is True or False and I want to check it value in the template. {{=default_fields['job_title']}} renders to True but this construct is returning SyntaxError: invalid syntax: {{ if {{=default_fields['job_title']}}: }} {{ pass }} How

[web2py] Re: How to check a value in a dictionary entry in template?

2011-11-27 Thread apple
{{=myvariable}} outputs myvariable to the page. You just need to refer to the variable. Here is an example: {{if default_fields['job_title']:}} divthe job title is /div{{=default_fields['job_title']}} {{pass}} The first one checks the value. The second outputs to the page. On Nov 27, 9:22 am,

Re: [web2py] Re: Webfaction: Memory usage way over your limit ; again.

2011-11-27 Thread Vasile Ermicioi
but the binary works as it executes web2py and website works but doesn't allow me to login (without showing errors) and my flex app shows the error that I wrote before, and --version shows this error ./uwsgi --version uWSGI 1.0-dev *** glibc detected *** ./uwsgi: free(): invalid pointer:

[web2py] Adding custom fields or virtual fields to rows object

2011-11-27 Thread villas
I know we had this discussion about a year ago and Bruno et al wrote their own code and proposed patches to try and get around this limitation, which also limits the usefulness of SQLTABLE. I just wondered if we had any new methods or techniques to add columns etc to the rows object.

[web2py] Re: Adding custom fields or virtual fields to rows object

2011-11-27 Thread Anthony
Virtual fields can already be added to Rows objects: http://web2py.com/book/default/chapter/06#Virtual-Fields. Also, SQLTABLE takes an 'extracolumns' argument, like this: extracolums = [{'label':A('Extra',_href='#'), 'class': '', #class name of the header

[web2py] PostgreSQL names case sensitivity

2011-11-27 Thread Alan Etkin
Hi, I am trying to use PostgreSQL DAL interface with my project, but i'm having trouble with table references and insert/update/delete commands. The system info: OS: GNU/Linux, web2py 1.99.2, PostgreSQL 8.4 I have tried the workaround posted by pbreit for a very similar problem:

[web2py] Problem understanding imports

2011-11-27 Thread david.waldrop
I am trying to use the suggest widget plugin, but am getting an error on the import. from plugin_suggest_widget import suggest_widget db.auth_user.org_ref.widget = suggest_widget(db.org.name, limitby=(0,10), min_length=1) and get the error: Traceback (most recent call last): File

[web2py] I cant start the web2py shell

2011-11-27 Thread chawk
I have tried to start the shell through windows dos prompt by typing: python web2py.py -s test -m and i get this: python cant open file web2py.py no such file or directory not sure why i cannot get this working.

[web2py] Re: How to check a value in a dictionary entry in template?

2011-11-27 Thread Constantine Vasil
Thank you!

Re: [web2py] I cant start the web2py shell

2011-11-27 Thread Javier Quarite
and i get this: python cant open file web2py.py no such file or directory It seems that you're not inside web2py directory

Re: [web2py] I cant start the web2py shell

2011-11-27 Thread Kenneth Lundström
Are you in the folder wher you have installed web2py? Kenneth I have tried to start the shell through windows dos prompt by typing: python web2py.py -s test -m and i get this: python cant open file web2py.py no such file or directory not sure why i cannot get this working.

Re: [web2py] Problem understanding imports

2011-11-27 Thread Bruno Rocha
probably there is an error in the plugin module. the error can be in syntax or importing something inside the module. check if the plugin is not trying to import another module. I often have problems like that when there is some errors ij module. http://zerp.ly/rochacbruno Em 27/11/2011 12:47,

[web2py] Re: cross-platform apps

2011-11-27 Thread VP
Thanks Anthony. Is Skeletion configured by default when a new application is created or it's just in this welcome app? Thanks, VP On Nov 26, 10:35 pm, Anthony abasta...@gmail.com wrote: On the server side, request.user_agent() returns info about the user agent, and

[web2py] some ideas on built-in emphasis on client-side processing for web2py

2011-11-27 Thread VP
Hi massimo and everyone, Hope everyone is doing fine. With support for Pyjamas, Massimo must have thought of this, but for some reason I feel something ain't right with the Pyjamas' approach. I have just realised that there has been massive amount of effort dedicated to client-side processing

[web2py] Translation error in SQLFORM.grid

2011-11-27 Thread José L .
When using SQLFORM.grid, the message: '%(nrows)s records found' is never translated and it fills the language/lang.py file with untranslated strings whenever the number of rows change. Changing in gluon/sqlhtml.py, in the grid static method, the line: message = error or T('%(nrows)s records

[web2py] Re: cross-platform apps

2011-11-27 Thread Anthony
The 'welcome' app is the foundation for any new app created via 'admin', so yes, you'll get the Skeleton scaffold for any new app. Note, this is currently only in trunk -- I believe Massimo is planning the next release very soon. Anthony On Sunday, November 27, 2011 11:45:47 AM UTC-5, VP

[web2py] how to change form.custom.submit background?

2011-11-27 Thread Constantine Vasil
I am following the example to make my own custom form design: http://www.web2py.com/book/default/chapter/ {{=form.custom.begin}} Image name: div{{=form.custom.widget.name}}/div Image file: div{{=form.custom.widget.file}}/div Click here to upload: {{=form.custom.submit}} {{=form.custom.end}}

[web2py] Re: how to change form.custom.submit background?

2011-11-27 Thread Anthony
In the controller or view, you should be able to do: form.custom.submit['_data-theme'] = 'e' or form.custom.submit.update(**{'_data-theme': 'e'}) form.custom.submit is just an INPUT helper, so you can add additional attributes to it like any html helper object. Anthony

[web2py] Re: I cant start the web2py shell

2011-11-27 Thread chawk
I must be missing something, i have always run web2py by downloading and extracting to a directory. i then double click the web2py.exe and it starts the server, but i cannot ever get the shell to work, so that i can practice with the DAL. is there more to installing it then this?

[web2py] Re: how to change form.custom.submit background?

2011-11-27 Thread Constantine Vasil
Thank you, this was so simple!

[web2py] Re: Adding custom fields or virtual fields to rows object

2011-11-27 Thread villas
Hi Anthony, Thanks for that, I couldn't remember about the 'extracolumns' and I don't think they were in the book yet (unless just recently). With regards the virtual fields, I was still struggling with including the virtualfields when limiting columns. This works fine: rows =

[web2py] how to update auth_user first_name last_name programmatically?

2011-11-27 Thread Constantine Vasil
I want to change auth_user first_name and last name progrmmaically having the user id: I tried this: db.auth_user[id] = dict(first_name=first_name) db.auth_user[id] = dict(last_name=last_name) but when reaching this statement in my db.py file I don't see auth updated: db =

Re: [web2py] Re: I cant start the web2py shell

2011-11-27 Thread ~redShadow~
On Sun, 2011-11-27 at 12:13 -0800, chawk wrote: I must be missing something, i have always run web2py by downloading and extracting to a directory. i then double click the web2py.exe and it starts the server, but i cannot ever get the shell to work, so that i can practice with the DAL. is

[web2py] Re: how to update auth_user first_name last_name programmatically?

2011-11-27 Thread Massimo Di Pierro
Any of these will work: db.auth_user[id] = dict(first_name=first_name) db.auth_user[id].update_record(first_name=first_name) db(db.auth_user.id==id).update(first_name=first_name) the problem is (I believe) that auth caches the current logged in user in session.auth.user==auth.user so you also

[web2py] simpatiCA -- A simple PKI for x509 in web2py

2011-11-27 Thread Michele Comitini
Hi list, I have released a small PKI implementation for those who need to start with web2py + SSL/TLS + x509. At the moment the documentation is 0, but it is quite simple so anyone that has some knowlege of PKI can try to use it. Please note that today it is still very basic and too young to be

[web2py] Re: I cant start the web2py shell

2011-11-27 Thread chawk
I don't understand, i am using windows 7, python 2.7, python is added to my enviroment variables, I even downloaded another copy of web2py, extracted it to the c directory, i cd into web2py directory, i ran the exact thing shown and i get the error: python: cant open file 'web2py.py' : [Errno

Re: [web2py] Re: I cant start the web2py shell

2011-11-27 Thread Javier Quarite
On Sun, Nov 27, 2011 at 5:23 PM, chawk chrshawke...@gmail.com wrote: I don't understand, i am using windows 7, python 2.7, python is added to my enviroment variables, I even downloaded another copy of web2py, extracted it to the c directory, i cd into web2py directory, i ran the exact thing

[web2py] Re: I cant start the web2py shell

2011-11-27 Thread Anthony
Don't download the Windows version -- it has it's own Python 2.5 interpreter. Instead, download the source version -- that will run with your own Python 2.7 installation. Anthony On Sunday, November 27, 2011 5:23:47 PM UTC-5, chawk wrote: I don't understand, i am using windows 7, python 2.7,

[web2py] Re: I cant start the web2py shell

2011-11-27 Thread chawk
Thanks Anthony! that was the problem, i was not aware that python 2.5 comes with the standard web2py version. i downloaded the source and the problem is solved.

[web2py] Re: how to update auth_user first_name last_name programmatically?

2011-11-27 Thread Constantine Vasil
Hi Massimo, It worked, the cache was the issue. Also is it possible to update both first and last name in batch? This is a general question how can the database fields can be updated in one operation? Thank you, the framework is excellent!

[web2py] on micro frameworks

2011-11-27 Thread Massimo Di Pierro
http://rawsyntax.com/blog/the-problem-with-micro-frameworks/

[web2py] Re: simpatiCA -- A simple PKI for x509 in web2py

2011-11-27 Thread Massimo Di Pierro
:-) On Nov 27, 4:18 pm, Michele Comitini michele.comit...@gmail.com wrote: Hi list, I have released a small PKI implementation for those who need to start with web2py + SSL/TLS + x509. At the moment the documentation is 0, but it is quite simple so anyone that has some knowlege of PKI can

[web2py] Re: how to update auth_user first_name last_name programmatically?

2011-11-27 Thread Massimo Di Pierro
Any of these will do: db.auth_user[id] = dict(first_name=first_name,last_name=last_name) db.auth_user[id].update_record(first_name=first_name,last_name=last_name) db(db.auth_user.id==id).update(first_name=first_name,last_name=last_name) On Nov 27, 5:51 pm, Constantine Vasil thst...@gmail.com

[web2py] Decimal vs float

2011-11-27 Thread pbreit
I have some price fields specified as type 'decimal'. But am finding that I have to cast to 'float' do do any math (or the other to decimal.Decimal I guess). This seems cumbersome. Is 'decimal' the best field type for storing financial amounts that will be involved in math calculations?

[web2py] Re: Decimal vs float

2011-11-27 Thread Massimo Di Pierro
You should not need any casting to do math computations. Can you provide an example of what you do, perhaps something does not behave as intended. On Nov 27, 7:33 pm, pbreit pbreitenb...@gmail.com wrote: I have some price fields specified as type 'decimal'. But am finding that I have to cast to

[web2py] SQLFORM.factory and custom HTML form radio boxes

2011-11-27 Thread Constantine Vasil
I am using SQLFORM.factory to set several fields and a custom form setting a radio boxes like this: input type=radio name=primary-email-choice id=id_email_home_ch value=Home checked=yes/ I want the code if form.process(formname='myinfo').accepted: to be able to check if id_email_home_ch is

[web2py] Error in custom_import and Pyforum

2011-11-27 Thread mikech
Hi: I downloaded Pyforums in order to study some code in what looks like a very well done application. When I try to look at the default index view I get the following error: 1. 2. 3. 4. 5. 6. 7. Traceback (most recent call last): File gluon/restricted.py, line 194, in restricted File

[web2py] How to preselect radio check box with checked=yes using SQLFORM.factory?

2011-11-27 Thread Constantine Vasil
in SQLFORM.factory I have defined a radio check box. Field('primary_email_choice_new', widget=SQLFORM.widgets.radio.widget, requires=IS_IN_SET({'Work' : 'Work', 'Home' : 'Home'})), It shows on the form but I need to set it checked=yes one of the values. The

[web2py] Re: Adding custom fields or virtual fields to rows object

2011-11-27 Thread Anthony
Good point. Maybe submit an issue on Google Code: http://code.google.com/p/web2py/issues/list On Sunday, November 27, 2011 3:58:37 PM UTC-5, villas wrote: Hi Anthony, Thanks for that, I couldn't remember about the 'extracolumns' and I don't think they were in the book yet (unless just

[web2py] Re: How to preselect radio check box with checked=yes using SQLFORM.factory?

2011-11-27 Thread Anthony
Try: Field('primary_email_choice_new', widget=SQLFORM.widgets.radio.widget, requires=IS_IN_SET({'Work' : 'Work', 'Home' : 'Home'}), default='Home') Also, I think it's checked=checked, not checked=yes. Anthony On Sunday, November 27, 2011 9:59:30 PM UTC-5, Constantine Vasil wrote: in

[web2py] Re: SQLFORM.factory and custom HTML form radio boxes

2011-11-27 Thread Anthony
form.vars will include the input field name, not id. Radio buttons will have the same name, and that name should be in form.vars, with the value of the particular radio button selected. Note, you may need to change the name to 'primary_email_choice' so it can be used as a Python identifier.

[web2py] Re: on micro frameworks

2011-11-27 Thread Anthony
Similar points here: http://www.reddit.com/r/Python/comments/f8so6/best_framework_for_gae/c1ebgn0

[web2py] Re: How to preselect radio check box with checked=yes using SQLFORM.factory?

2011-11-27 Thread Constantine Vasil
HI Anthony, Thank you! This is useful information not available in the book. Now I would define the default in the form definition: form = SQLFORM.factory How to change it programmatically to other checked value before the form is submitted? This can be needed for a reason as I do -

[web2py] Re: SQLFORM.factory and custom HTML form radio boxes

2011-11-27 Thread Constantine Vasil
Basically I reverse engineered the HTML generated from web2py and came with the following solution: In SQLFORM.factory I have this definition: Field('*primary_email_choice*', widget=SQLFORM.widgets.radio.widget, requires=IS_IN_SET({'Work' : 'Work', '*Home*' : 'Home'})), So in the HTML

[web2py] Quick Question about Wiki Tutorial: .default attribute for db foreign-key field

2011-11-27 Thread Aaron Levin
Hi, For the Wiki Tutorial, In the show(): controller in default.py there is the following statement: db.comment.page_id.default = this_page.id I can't quite figure out what it means. Are we setting the default value of the page_id field for the comment table to be 'this_page.id? However, in

[web2py] Re: Adding custom fields or virtual fields to rows object

2011-11-27 Thread Massimo Di Pierro
This works fine: rows = db(db.table.id0).select() for row in rows: print row.myvirtualfield that is because the row.myvirtualfield is computed AFTER the sql select But this does not: rows = db(db.table.id0).select(db.table.id, db.table.myvirtualfield) because there is no such a thing as a

[web2py] Book typo

2011-11-27 Thread Johann Spies
In http://www.web2py.com/book/default/chapter/06?search=form.process ret = db(query).vaidate_and_update(field='value') should probably be ret = db(query).validate_and_update(field='value') Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise

Re: [web2py] PostgreSQL names case sensitivity

2011-11-27 Thread Johann Spies
On 27 November 2011 16:28, Alan Etkin spame...@gmail.com wrote: psycopg2.ProgrammingError: relation debugging_id_seq does not exist Maybe a typo somewhere where debugging_id_seq should be debugging.id_seq? Regards Johann -- Because experiencing your loyal love is better than life itself, my

Re: [web2py] Quick Question about Wiki Tutorial: .default attribute for db foreign-key field

2011-11-27 Thread Bruno Rocha
The complete commented code is: def show(): shows a wiki page * # request.args(0) should receive an ID for the page you want to 'whow' # you query the database to fetch the page row* this_page = db.page(request.args(0)) or redirect(URL('index')) * # for this action

[web2py] could use some help ... mobile admin

2011-11-27 Thread Massimo Di Pierro
I could use some help. In trunk there is code for mobile admin. That means that if you visit admin from a mobile device it will use jquery.mobile. This is a work in progress and only some pages have been implemented but you can help. It is easy. In applications/admin/controllers/default.py there

[web2py] Re: PostgreSQL names case sensitivity

2011-11-27 Thread Massimo Di Pierro
In gluon/dal.py there is the following code: def sequence_name(self,table): return '%s_id_Seq' % table is generates the default name of a sequence. if you have a sequence already and it has another name use db.define_table(...,sequence_name = '...') On Nov 28, 12:16 am, Johann Spies

[web2py] Problems with forms and firefox

2011-11-27 Thread Bruno Rocha
Hi, I am trying to solve a problem (all day long and I cannot find the source of this) I have a comment form in a page, also I have another page with edit form, and one with create form. Every form works ok with Google Chrome, I also tested in Midori and Safari(running on wine) and it works ok.

Re: [web2py] could use some help ... mobile admin

2011-11-27 Thread Angelo Compagnucci
Great! I'll work on it a soon as possible! Are you using the Auto-initialization of form elements ? Thanks! 2011/11/28 Massimo Di Pierro massimo.dipie...@gmail.com: I could use some help. In trunk there is code for mobile admin. That means that if you visit admin from a mobile device it