[web2py] Re: Problem with inserting a text in a database field

2010-06-14 Thread Berti
I tried to cut the string to insert for 10 characters. Now it stops at an other point, about 400 messages later and I get the following error. I cannot sort that out. Traceback (most recent call last): File "/Applications/web2py/gluon/restricted.py", line 178, in restricted exec ccode in env

[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Niphlod
You can use request.now, that is a default datetime.datetime object.. e.g. (paste this on the view) month: {{=request.now.month}} day : {{=request.now.day}} ... On 14 Giu, 00:32, Giuseppe Luca Scrofani wrote: > Hi, how I can insert in a page not served by a controller (think > layout.

[web2py] Re: working with views or stored procedures.

2010-06-14 Thread Niphlod
you should set a primaryekey into the definition of the table.. (see http://groups.google.com/group/web2py/msg/c9848792a8999c5f) I think that simple selects are possibile on views On 13 Giu, 08:57, Sky wrote: > I need to display data from a VIEW ( not table) of database. > can any one help m

[web2py] Re: database locked SQLITE

2010-06-14 Thread mdipierro
please tell us more about the conditions that cause it. If you use the shell (or background process) at the same time as the web app make sure you unlock the db with periodic db.commit() Massimo On Jun 12, 9:42 pm, dbb wrote: > Help resolving this issue, the database keeps locking, the trace is

[web2py] Re: Internationalization of invalidators' error_message

2010-06-14 Thread mdipierro
Because T is defined in your apps but not in the modules. We could fix this by redefining T using thread local variables. We'll work on this. On Jun 13, 5:28 am, dlin wrote: > I don't understand why not the invalidators' error_message only use > English. > eg. > class IS_NOT_EMPTY(Validator): >  

[web2py] Re: kpax cms: issue fixing - gae compatibility - refactoring

2010-06-14 Thread mdipierro
I am out of town with a limited and slow network access for the next two weeks. We will try post this asap. Thank you. On Jun 13, 10:05 am, molhokwai wrote: > Hello all, > > Modified a few things in kpax to make it compatible with gae. > (files attached, or pasted below). > And not willing to con

[web2py] Re: Select the most recent entry from multiple tables

2010-06-14 Thread mdipierro
You have to merge them in a list and sort them at the Python/web2py level. You may be able to do dataset_three=(dataset_one+dataset_two).sort(lambda row: row['sortfilename']) assuming both tables have the same sortfiledname and have similar record structures. Try and let us know. On Jun 13, 12:

[web2py] Re: working with views or stored procedures.

2010-06-14 Thread Jose
I am working with a legacy database and am using many views, so as to bridging differences with tables. All the views will create a numeric id field for compatibility, but not in use. Jose

[web2py] my app instead of welcome app???

2010-06-14 Thread Jean-Guy
Hello, Can't figure it out how to let my app load at 127.0.0.1 on prod server apache under ubuntu... I remove the welcome app and web2py still search to load it. Thanks Jonhy

[web2py] Re: Unable to connect to mysql DB - sql.py mod

2010-06-14 Thread mdipierro
This line: self._execute("SET sql_mode='NO_BACKSLASH_ESCAPES';") is important for security issues. SQL injections may be possible if you comment it. I do not know why it does not work on your system. It should http://mysql.linux.cz/doc/refman/5.5/en/server-sql-mode.html#sqlmode_no_ba

[web2py] Re: Internal error

2010-06-14 Thread mdipierro
this should work with 8.1 and later. Is it possible that it is fixed at the postgres configuration file? On Jun 13, 9:42 pm, Cory Coager wrote: > Here is the error when using PostGreSQL: > > Traceback (most recent call last): > File "gluon/restricted.py", line 178, in restricted > exec ccode in e

[web2py] Re: import of web2py modules very complicated

2010-06-14 Thread mdipierro
It depends. If you want to import any NORMAL python module, put it in site packages and import it using normal python syntax. If you want to import "web2py modules", i.e. modules that belong to a specific application only, then you have to follow the rules and not all modules can be imported this

[web2py] Re: upload file -- lot of file in one directory

2010-06-14 Thread mdipierro
This is not supported. this would break your ability to retrieve the files you uploaded. On Jun 13, 10:33 am, weheh wrote: > Aha! So then could you write the following: > > import random > Field('filename','upload', >   uploadfolder=['c:/web2py/myapp/uploads','d:/extrastorage/myapp/ > uploads'][r

[web2py] Re: Multiple form submission - is doc wrong?

2010-06-14 Thread mdipierro
I just tried it from the shell >>> form=SQLFORM(db.auth_user) >>> form.accepts({},formname='form1') False >>> print form I think the manual is correct. Something else is wrong in your code. On Jun 13, 6:50 pm, weheh wrote: > I have a multiple form submission with a custom form. > > #control

[web2py] Re: Multiline labels for fields in SQLForm

2010-06-14 Thread mdipierro
label=SPAN('line1',BR(),'line2') On Jun 14, 1:14 am, Johann Spies wrote: > I would like to have multiline labels for fields in input forms.  Is > it possible to use SQLForm to produce that or should I do by hand > using FORM? > > Regards > Johann > > -- > "Finally, brethren, whatsoever things are

[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread mdipierro
No do not worry. The import only happes the first time, than the module is cached. On Jun 13, 5:32 pm, Giuseppe Luca Scrofani wrote: > Hi, how I can insert in a page not served by a controller (think > layout.html in the welcome application) current day and month? > > I've tested something like

Re: [web2py] my app instead of welcome app???

2010-06-14 Thread Vasile Ermicioi
create routes.py (or rename routes.example.py) from web2py folder routes_in = ( ('/', '/yourappname/'), ) and restart web2py

[web2py] FW: Okinawa Institute of Science and Technology - Experienced manager of high-performance computing systems - Okinawa

2010-06-14 Thread DiPierro, Massimo
FYI From: Jeff [knightjeff...@gmail.com] Sent: Sunday, June 13, 2010 11:40 PM To: DiPierro, Massimo Subject: Fwd: Okinawa Institute of Science and Technology - Experienced manager of high-performance computing systems - Okinawa Dr DiPierro, I was

[web2py] Re: my app instead of welcome app???

2010-06-14 Thread mdipierro
or simply call your app "init" On Jun 14, 7:19 am, Vasile Ermicioi wrote: > create routes.py (or rename routes.example.py) from web2py folder > > routes_in = ( > ('/', '/yourappname/'), > ) > > and restart web2py

[web2py] Problem with two forms in one page(one post, other get)

2010-06-14 Thread Lisandro Rostagno
I have tried this: def mytest(): form_one = SQLFORM.factory() form_two = SQLFORM.factory() if form_one.accepts(request.vars, session, formname='one'): response.flash = 'Form one' if form_two.accepts(request.vars, session, formname='two'): response.flash = 'Form tw

Re: [web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Giuseppe Luca Scrofani
Thanks for answering friends, it worked! Now, how I can setup a condition block to transform the digit returned by {{=request.now.month}} (example: 6) into something like "giugno" (june in italian language)? > e.g. (paste this on the view) > > month: {{=request.now.month}} > day : {{=reque

Re: [web2py] Re: multiple select jquery plugin

2010-06-14 Thread Jean-Guy
On 2010-06-10 15:05, mr.freeze wrote: Another option: http://www.web2pyslices.com/main/slices/take_slice/70 On Jun 10, 2:02 pm, mdipierro wrote: http://web2py.com/plugins/default/multiselect On Jun 10, 1:57 pm, Jean Guy wrote: I don't remember how I come with this link :http://a

[web2py] [BUG] solution for form.custom.widget and custom widget

2010-06-14 Thread ont.rif
For complex widgets there is bug. During form validation "_traverse" method doesn't change form.custom.widget. But field.widget(field, value) return correct representation. This is lead to wrong field widget output for custom form and custom widget when error occurred. Solution is simple: --- sqlh

[web2py] Re: Unable to connect to mysql DB - sql.py mod

2010-06-14 Thread The Czar
I am not running V5.5 MySQL - I am using mysql v4.1.25. Maybe a difference there! On Jun 14, 5:06 am, mdipierro wrote: > This line: > >             self._execute("SET sql_mode='NO_BACKSLASH_ESCAPES';") > > is important for security issues. SQL injections may be possible if > you comment it. I do

[web2py] Re: Unable to connect to mysql DB - sql.py mod

2010-06-14 Thread The Czar
I just checked the docs for the older version (4.1) SQL Modes. There is no mention of the NO_BACKSLASH_ESCAPES mode. http://dev.mysql.com/doc/refman/4.1/en/server-sql-mode.html We have some unintended consequences. I'm surprised it doesn't complain about this. On Jun 14, 5:06 am, mdipierro wrot

Re: [web2py] Re: Select the most recent entry from multiple tables

2010-06-14 Thread Giuseppe Luca Scrofani
I've tried, I get this when trying to add dataset_one and two: TypeError: unsupported operand type(s) for +: 'Rows' and 'Rows' I "feel" there is something to do before adding, like convert to another datatype, but my incompetence limits me... (I hope I dont stretch my luck with all this question

[web2py] My table won't appear in auth_permission : table name

2010-06-14 Thread Jean-Guy
Hello web2py crowd, How can I make appear my tables in auth_permission "table name" dropbox? Does that I should be able to define permission on them? Thank you. Jonhy

[web2py] Re: Internal error

2010-06-14 Thread Cory Coager
According to the postgresql 8.1 documentation, standard_conforming_strings is a read-only variable. http://postgresql2.openmirrors.org/docs/8.1/static/release-8-1.html

[web2py] error auth_user already exists

2010-06-14 Thread annet
I altered something in the db.py file, the file contains the following custom auth_user table: auth.settings.table_user = db.define_table('auth_user', Field('first_name',length=24,default=''), Field('last_name',length=42,default=''), Field('bedrijf_id',db.bedrijf,default='',notnull=True

Re: [web2py] error auth_user already exists

2010-06-14 Thread Jean-Guy
On 2010-06-14 11:34, annet wrote: ed something in the db.py file, the file contains the following custom auth_user table: If you are developping and testing using sqlite and your database not content important data... I think you can just erase everything in database folder... Jonhy

[web2py] Re: kpax cms: issue fixing - gae compatibility - refactoring

2010-06-14 Thread Christopher Steel
Cool, thanks Molhowkwai. Chris On Jun 13, 11:05 am, molhokwai wrote: > Hello all, > > Modified a few things in kpax to make it compatible with gae. > (files attached, or pasted below). > And not willing to continue, for the moment. > > If there is a version that is, 'll be happy to  know where t

[web2py] Defining db.py for the first time problem (db references possible?)

2010-06-14 Thread zsouthboy
Problem: I don't see how to specify multiple tables with table references to each other. I can't simply define the relationship, because the DAL hasn't created a table yet to reference. But I can't create the table(s) because they reference tables that also don't exist yet. Catch 22. Besides manual

[web2py] Help needed adding rows to a database table...

2010-06-14 Thread Jeff Elkner
It is the end of the school year and my students and I are trying to create simple projects using web2py. Can you point me to a "simple" example of web2py creating and accessing a database? By "simple" I mean from the teaching perspective. I wanted to create a little application that stored quot

[web2py] Setting up a web2py server...

2010-06-14 Thread Jeff Elkner
Hi Massimo, I'm still working on a recipe for setting up a web2py server on Ubuntu 10.04. I've asked the help of a friend, Douglas Cerna, who does not know web2py, but who is a Zope 3 developer on the SchoolTool project. We are interested in using web2py to create websites for some schools with w

[web2py] Re: error auth_user already exists

2010-06-14 Thread annet
Hi Jonhy, Thanks for your reply. I am using PostgreSQL, and the auth_ tables contain data, so I cannot simply drop them, empty the databases folder and redefine them. I hope there is a solution which allows me to keep the tables in the PostgreSQL database. Kind regards, Annet.

Re: [web2py] Re: error auth_user already exists

2010-06-14 Thread Jean-Guy
On 2010-06-14 13:18, annet wrote: is a solution which allows me to keep the tables in the PostgreSQL database. ,migrate=False : at the end of your model... Ex.: db.define_table('atable', SQLField('var1'), SQLField('var2'),migrate=False) modify your table in postgres and define t

[web2py] Re: My table won't appear in auth_permission : table name

2010-06-14 Thread Jean-Guy
On 2010-06-14 10:59, Jean-Guy wrote: Hello web2py crowd, How can I make appear my tables in auth_permission "table name" dropbox? Does that I should be able to define permission on them? Thank you. Jonhy Answering to myself... Here is the solution : http://www.mail-archive.com/web2py@goo

[web2py] Re: Defining db.py for the first time problem (db references possible?)

2010-06-14 Thread Yarko Tymciurak
On Jun 14, 8:51 am, zsouthboy wrote: > Problem: I don't see how to specify multiple tables with table > references to each other. I can't simply define the relationship, > because the DAL hasn't created a table yet to reference. But I can't > create the table(s) because they reference tables tha

Re: [web2py] Re: Multiline labels for fields in SQLForm

2010-06-14 Thread Johann Spies
On 14 June 2010 14:17, mdipierro wrote: > label=SPAN('line1',BR(),'line2') Thanks! Johann -- "Finally, brethren, whatsoever things are true, whatsoever things are honest, whatsoever things are just, whatsoever things are pure, whatsoever things are lovely, whatsoever things are of good repor

[web2py] Re: Help needed adding rows to a database table...

2010-06-14 Thread Yarko Tymciurak
Hi Jeff - Have a look at the examples in Chapter 3 - http://www.web2py.com/book/default/section/3, particularly leading into http://www.web2py.com/book/default/section/3/5 This should help you get your example working. It is also helpful to think of the flow through web2py of the request / reqp

[web2py] Re: Help needed adding rows to a database table...

2010-06-14 Thread Yarko Tymciurak
... you can also look at http://web2py.com/examples/default/examples, perhaps example 30 onward. (Someone sent a post noting you have this same examples application in your local web2py - unfortunately, the message would not post with the localhost links it contained). On Jun 14, 1:36 pm, Yarko

[web2py] rocket.ssl not found

2010-06-14 Thread davidjensen
I am running 1.79.2 on red hat enterprise linux with python 2.5 on a hosting service with static ip and using port 8080. I have openssl. I am getting the error message use "kill -SIGTERM 2457" to shutdown the web2py server Traceback (most recent call last): File "web2py.py", line 20, in g

[web2py] Documentation on moving common code into modules?

2010-06-14 Thread David Mitchell
Hello all, I'm at early days in my 1st serious web2py project, and I've got a few bits of code that are common to multiple different controllers. I want to move these code blocks into their own separate code module so they can be maintained at a single place, but I can't find any documentation ab

Re: [web2py] Documentation on moving common code into modules?

2010-06-14 Thread Robert O'Connor
throw it into the "modules" directory in its own file say foo.py -Rob On Mon, Jun 14, 2010 at 5:11 PM, David Mitchell wrote: > Hello all, > > I'm at early days in my 1st serious web2py project, and I've got a few bits > of code that are common to multiple different controllers. > > I want to mo

[web2py] Re: PIL to change images on the fly...

2010-06-14 Thread howesc
on GAE i use: def download(): ...do stuff return img.execute_transforms(images.JPEG) where the google image object (img) returns a binary stream as a result of execute_transforms. if you return just binary data from a controller function in web2py, web2py does nothing more to the return, it ju

[web2py] Re: Documentation on moving common code into modules?

2010-06-14 Thread Yarko Tymciurak
On Jun 14, 4:21 pm, "Robert O'Connor" wrote: > throw it into the "modules" directory in its own file say foo.py > -Rob or perhaps utils.py - note that modules will need to be imported everywhere you want to use them (which is ok - use local_import()); An alternative is to add a utils.py in

[web2py] Syntax highlighting for multiline string with pound character

2010-06-14 Thread Meteormarc
In the controller, when I have a multiline string with a pound (#) character in it, the syntax highlighting in the web editor gets mixed up and anything after the string is purple (like being part of the string). A workaround is using scriptstr=("..." "..." "..."), but that does not look nice eithe

[web2py] upload bug in filename

2010-06-14 Thread Swell
Hi , I tried to send a file with a form containing a upload field( actually it is a SQLFORM). When i try to add a new record with the administrative db interface , it breaks if the filename if very long ( not sure where it comes from ). Any idea? Thx

[web2py] Re: Documentation on moving common code into modules?

2010-06-14 Thread Richard
have a look at some of the example apps: http://web2py.com/appliances The main issue with migrating model/controller code into modules is you no longer have access to the global variables like db/session/etc. So you have to pass these variables explicitly to the modules when needed. On Jun 15, 7

[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Richard
If you want this variable globally available for all views then put `giugno = 6' into a model. Or if you only want this variable for a certain view then pass it explicitly in the controller with `return dict(giugno=6, ...)' Then in the view[s] you can use {{= giugno }} On Jun 14, 11:58 pm, Giuse

[web2py] Re: Documentation on moving common code into modules?

2010-06-14 Thread Yarko Tymciurak
On Jun 14, 7:19 pm, Richard wrote: > have a look at some of the example apps:http://web2py.com/appliances > > The main issue with migrating model/controller code into modules is > you no longer have access to the global variables like db/session/etc. > So you have to pass these variables explicitl

[web2py] Re: Documentation on moving common code into modules?

2010-06-14 Thread weheh
+1 regarding Yarko's suggestion. Putting common code into modules is probably the easiest way to have it visible to all controllers. It seems a little kludgy at first, but you get used to it. The one thing to be aware of is that models get executed in alphabetic order. So you may want to stick a nu

Re: [web2py] upload bug in filename

2010-06-14 Thread Thadeus Burgess
how long is the filename? Isn't there like a 255 char limit to filenames? -- Thadeus On Mon, Jun 14, 2010 at 4:58 PM, Swell wrote: > Hi , >  I tried to send a file with a form containing a upload > field( actually it is a SQLFORM). When i try to add a new record with > the administrative db

Re: [web2py] Re: my app instead of welcome app???

2010-06-14 Thread Thadeus Burgess
Why can't we configure the default name of 'init' ? -- Thadeus On Mon, Jun 14, 2010 at 7:33 AM, mdipierro wrote: > or simply call your app "init" > > On Jun 14, 7:19 am, Vasile Ermicioi wrote: >> create routes.py (or rename routes.example.py) from web2py folder >> >> routes_in = ( >> ('/',

[web2py] Re: my app instead of welcome app???

2010-06-14 Thread Richard
would that go against the web2py philosophy of having no configuration files? On Jun 15, 1:33 pm, Thadeus Burgess wrote: > Why can't we configure the default name of 'init' ? > > -- > Thadeus > > On Mon, Jun 14, 2010 at 7:33 AM, mdipierro wrote: > > or simply call your app "init" > > > On Jun 1

[web2py] Re: Internationalization of invalidators' error_message

2010-06-14 Thread dlin
And, if changed to T() form. Will that let the 'doc test' failed in validation functions(such as IS_NO_EMPTY())? On 6月14日, 下午7時57分, mdipierro wrote: > Because T is defined in your apps but not in the modules. We could fix > this by redefining T using thread local variables. > We'll work on this.

[web2py] Re: Unable to connect to mysql DB - sql.py mod

2010-06-14 Thread mdipierro
what is the default bahvior? On Jun 14, 9:51 am, The Czar wrote: > I just checked the docs for the older version (4.1) SQL Modes. There > is no mention of the NO_BACKSLASH_ESCAPES mode. > > http://dev.mysql.com/doc/refman/4.1/en/server-sql-mode.html > > We have some unintended consequences. I'm s

[web2py] Re: Select the most recent entry from multiple tables

2010-06-14 Thread mdipierro
My bad dataset_three=(dataset_one|dataset_two).sort(lambda row: row['sortfilename']) On Jun 14, 9:52 am, Giuseppe Luca Scrofani wrote: > I've tried, I get this when trying to add dataset_one and two: > > TypeError: unsupported operand type(s) for +: 'Rows' and 'Rows' > > I "feel" there is someth

[web2py] Re: Internal error

2010-06-14 Thread mdipierro
the 8.1 should not be used. the default convention is not conform to SQL and may result is security issues. On Jun 14, 10:28 am, Cory Coager wrote: > According to the postgresql 8.1 documentation, > standard_conforming_strings is a read-only variable. > > http://postgresql2.openmirrors.org/docs/8

[web2py] Re: Help needed adding rows to a database table...

2010-06-14 Thread Massimo Di Pierro
#model db=DAL('sqlite://storage.db') from gluon.tools import * auth=Auth(globals(),db) crud=Crud(globals(),db) db.define_table('quote',Field('message')) #controller @auth.requires_login() def index(): form=crud.create(db.quote) quotes=db(db.quote.id>0).select() return dict(form

[web2py] Re: Internationalization of invalidators' error_message

2010-06-14 Thread mdipierro
If you insert any T in any module T will not work as intended because it is not defined. On Jun 15, 12:02 am, dlin wrote: > And, if changed to T() form.  Will that let the 'doc test' failed in > validation functions(such as IS_NO_EMPTY())? > > On 6月14日, 下午7時57分, mdipierro wrote: > > > Because T

[web2py] Re: my app instead of welcome app???

2010-06-14 Thread mdipierro
because you do not have too, you can use ruotes already for this purpose. On Jun 14, 10:40 pm, Richard wrote: > would that go against the web2py philosophy of having no configuration > files? > > On Jun 15, 1:33 pm, Thadeus Burgess wrote: > > > Why can't we configure the default name of 'init' ?