[web2py:35599] Re: Internationalization

2009-11-18 Thread szimszon
Tnx. On Nov 18, 9:03 pm, mdipierro wrote: > I think you found a bug. I will watch the video again. > > On Nov 18, 2:00 pm, szimszon wrote: > > > I expect a different behavior or I don't understand how translation > > works :-o > > > What is different if there is T.force and T.current... and no.

[web2py:35598] Re: crud.create error

2009-11-18 Thread Wes James
my bad. I'm looping through the form and forgot: put that in and works like it supposed to. bonk... bonk... bonk... "computers do exactly what they're told..." thx, all -wes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

[web2py:35597] Re: Delete record from row object

2009-11-18 Thread mdipierro
yes we can. On Nov 18, 9:08 pm, Thadeus Burgess wrote: > Can we get a row.delete_record() just for grins? > > Pros > I can delete the row without knowing the table name (i'm thinking plugin > defined data) > > Cons > Adds "yet another way" of doing something. > > -Thadeus > > On Wed, Nov 18, 200

[web2py:35596] Re: possible ? WYSIWYG editor with integrated image upload

2009-11-18 Thread Thadeus Burgess
I have been using CKEditor (the newest version of FCK), I love it. All that it is missing is the ability to (like in plone/wordpress/etc) is upload images automatically. With CKEditor I believe this is relatively simple. -Thadeus On Wed, Nov 18, 2009 at 6:45 PM, Darcy Clark wrote: > > Just

[web2py:35595] Re: crud.create error

2009-11-18 Thread Wes James
I see where there error is happening: I'm doing a crud.create as the record is being built it gets to: if fields[fieldname] != None and isinstance(self.table,Table) and not keyed: fields[fieldname] = int(fields[fieldname]) in sqlhml.py sid has value '' in d

[web2py:35594] Re: Delete record from row object

2009-11-18 Thread Thadeus Burgess
Can we get a row.delete_record() just for grins? Pros I can delete the row without knowing the table name (i'm thinking plugin defined data) Cons Adds "yet another way" of doing something. -Thadeus On Wed, Nov 18, 2009 at 8:23 PM, mdipierro wrote: > > A Row object extends a dictionary and

[web2py:35593] Re: Data parser advice sort from web2py developers

2009-11-18 Thread mdipierro
It is not clear to me what does lxml do that element-tree does. Is it just an issue of speed? On Nov 18, 8:52 pm, Mark Larsen wrote: > I've had good experience with ElementTree: > > http://effbot.org/zone/element-index.htm > > It has both straight python and a CPython versions.  It's included >

[web2py:35592] Re: Data parser advice sort from web2py developers

2009-11-18 Thread Mark Larsen
I've had good experience with ElementTree: http://effbot.org/zone/element-index.htm It has both straight python and a CPython versions. It's included with Python >= 2.5. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

[web2py:35591] Re: Data parser advice sort from web2py developers

2009-11-18 Thread Richard
there is a feature request to add lxml to GAE: http://code.google.com/p/googleappengine/issues/detail?id=18 On Nov 19, 1:54 am, Carl wrote: > I saw those postings and checked out lxml. > alas lxml is built with some C libraries that aren't available on GAE. > > On Nov 18, 2:10 pm, DenesL wrote

[web2py:35590] Re: Delete record from row object

2009-11-18 Thread mdipierro
A Row object extends a dictionary and inherits an update method. It only updates the dict not the record. The us of it is that you can do: row.update(...) row.update(...) row.update(...) row.update_record() and the last update_record() without parameters will update the database with the previou

[web2py:35589] Re: web2py and postgresql

2009-11-18 Thread mdipierro
Yes. I do not think those lines belong in there. I was just suggesting a workaround. On Nov 18, 8:06 pm, Richard wrote: > isn't generating that exception every request going to be too much > overhead? > > On Nov 19, 7:37 am, mdipierro wrote: > > > The fact is, indices must be created only once.

[web2py:35588] Re: Delete record from row object

2009-11-18 Thread Richard
what is the use case for updating the row object instead of the database? I sometimes use update() instead of update_record(), so I would prefer update() threw an exception. Is it worth adding the equivalent delete_record()? On Nov 19, 10:43 am, mdipierro wrote: > you can do > > del db.table[

[web2py:35587] Re: web2py and postgresql

2009-11-18 Thread Richard
isn't generating that exception every request going to be too much overhead? On Nov 19, 7:37 am, mdipierro wrote: > The fact is, indices must be created only once. If you have the index > already that line fails. You handle the exception at the web2py level > but the transcation still aborts. T

[web2py:35586] Re: possible ? WYSIWYG editor with integrated image upload

2009-11-18 Thread Darcy Clark
Just did some research and Plone seems to be ditching kupu and adopting TinyMCE for Plone 4. On Nov 19, 10:20 am, Wes James wrote: > yep - like emacs vs vi - for plone it's kupu vs fckeditor ;) > > I wonder if kupu or fckeditor might work as an inline editor?? > > kupu seemed to be more specific

[web2py:35585] Re: crud.create error

2009-11-18 Thread mdipierro
Your error says: ValueError: invalid literal for int() with base 10: '' so there is a '' in the default somehow. On Nov 18, 6:00 pm, Wes James wrote: > so is the db.auth_user the problem or the default=user_id > > I took the default=user_id from the db.py in the book: > > if auth.is_logged_in(

[web2py:35584] Re: possible ? WYSIWYG editor with integrated image upload

2009-11-18 Thread Wes James
yep - like emacs vs vi - for plone it's kupu vs fckeditor ;) I wonder if kupu or fckeditor might work as an inline editor?? kupu seemed to be more specifically developed for plone, but fckeditor would work in many different places (web apps, etc.) -wes On Wed, Nov 18, 2009 at 5:09 PM, Darcy Cl

[web2py:35583] possible ? WYSIWYG editor with integrated image upload

2009-11-18 Thread Darcy Clark
I've come to web2py from a Plone CMS background. Plone integrated a WYSIWYG editor called kupu which allowed the upload and integration of images while you were editing rich content (i.e. web pages). It made for a smoother more integrated content editing experience in that you didn't have to separ

[web2py:35582] Re: crud.create error

2009-11-18 Thread Wes James
so is the db.auth_user the problem or the default=user_id I took the default=user_id from the db.py in the book: if auth.is_logged_in(): user_id = auth.user.id else: user_id = None book page 72 On Wed, Nov 18, 2009 at 4:47 PM, mdipierro wrote: > > The default for a reference field mus

[web2py:35581] Re: crud.create error

2009-11-18 Thread mdipierro
The default for a reference field must be None or an int or a string containing and int. It cannot be an empty string. It is ambiguous. It is not clear if it should be a None or a 0. On Nov 18, 4:48 pm, Wes James wrote: > What does this mean: > >     form=crud.create(db.student,next=URL(r=reques

[web2py:35580] Re: Delete record from row object

2009-11-18 Thread mdipierro
you can do del db.table[row.id] Mind that row.update(...) only updates the row object, not the database record. row.update_record(...) updates the database record. On Nov 18, 5:22 pm, Thadeus Burgess wrote: > A feature to delete the record from the current object would be nice, like > the

[web2py:35579] Re: crud.create error

2009-11-18 Thread Thadeus Burgess
Yes these are the hardest bugs to trace. But it means that python cannot convert the string into an integer... so your string will either be Null, '', 'a234' -Thadeus On Wed, Nov 18, 2009 at 5:21 PM, Wes James wrote: > > It's an auth db with the student db - like in the book. > > I register

[web2py:35578] Delete record from row object

2009-11-18 Thread Thadeus Burgess
A feature to delete the record from the current object would be nice, like the .update() method of the row, to have .delete() row = db(db.table.id > 0).select().first() ... #do some other queries with row data ... row.delete() # i don't need row anymore, so purge it from database. # I currently h

[web2py:35577] Re: crud.create error

2009-11-18 Thread Wes James
It's an auth db with the student db - like in the book. I register -> put some data in auth_user <- then I log in and put some data in to the student fields and click submit and this error pops up as ticket. I'm using an sqlite3 db on os x... I've even dropped the tables several times and retri

[web2py:35576] Re: crud.create error

2009-11-18 Thread Thadeus Burgess
It means you have a field that is expecting an integer, and the actual data in the database is either Null or has characters in the string, more often than not, it means this data is null. Try IS_NULL_OR(IS_IN_DB) as a solution? -Thadeus On Wed, Nov 18, 2009 at 4:48 PM, Wes James wrote: > >

[web2py:35575] crud.create error

2009-11-18 Thread Wes James
What does this mean: form=crud.create(db.student,next=URL(r=request)) File "/opt/cnrsa/gluon/tools.py", line 2101, in create deletable=False, File "/opt/cnrsa/gluon/tools.py", line 2048, in update keepvalues=self.settings.keepvalues): File "/opt/cnrsa/gluon/sqlhtml.py", line 865

[web2py:35574] Re: Dictionary as arguement in redirection

2009-11-18 Thread mdipierro
URL(r=request,f='admin_applicant_list_3',vars=roll_type) generates a url string. A url string can only only contain GET variables not POST variables. when combined with redirect(URL()) web2py returns a http 303 redirect and that, because of the http specs, is also a get. To my knowledge there i

[web2py:35573] Re: Dictionary as arguement in redirection

2009-11-18 Thread Thadeus Burgess
Can you specify it as POST? -Thadeus On Wed, Nov 18, 2009 at 3:09 PM, mdipierro wrote: > > GET > > On Nov 18, 3:08 pm, Thadeus Burgess wrote: > > does vars get passed as a GET url or a POST url? > > > > -Thadeus > > > > On Wed, Nov 18, 2009 at 3:03 PM, mdipierro > wrote: > > > > > args are

[web2py:35572] Re: web2py and postgresql

2009-11-18 Thread leone
Yes, I understand. Thanks On 18 Nov, 21:11, leone wrote: > If I put DAL and table definition in db.py all is Ok and sql.log > report: > CREATE TABLE secretnum( >         id SERIAL PRIMARY KEY, >         primocod VARCHAR(8), >         secondocod VARCHAR(5), >         terzocod VARCHAR(5), >      

[web2py:35571] Re: Dictionary as arguement in redirection

2009-11-18 Thread mdipierro
GET On Nov 18, 3:08 pm, Thadeus Burgess wrote: > does vars get passed as a GET url or a POST url? > > -Thadeus > > On Wed, Nov 18, 2009 at 3:03 PM, mdipierro wrote: > > > args are a list, vars are a dict. You should do > > > roll_type={'200909009':'full'} > > redirect(URL(r=request,f='admin_app

[web2py:35570] Re: Dictionary as arguement in redirection

2009-11-18 Thread Thadeus Burgess
does vars get passed as a GET url or a POST url? -Thadeus On Wed, Nov 18, 2009 at 3:03 PM, mdipierro wrote: > > args are a list, vars are a dict. You should do > > roll_type={'200909009':'full'} > redirect(URL(r=request,f='admin_applicant_list_3',vars=roll_type)) > > def admin_applicant_list

[web2py:35569] Re: Custom checkboxes widget

2009-11-18 Thread Thadeus Burgess
I finally got this to work. Basically, the requires field was not getting passed to the INPUT helper, since I was using **attributes instead of **attr. Passing field.requires to the INPUT helper, it works :) -Thadeus On Tue, Nov 17, 2009 at 12:08 AM, Thadeus Burgess wrote: > I can't get my

[web2py:35568] Re: Dictionary as arguement in redirection

2009-11-18 Thread mdipierro
args are a list, vars are a dict. You should do roll_type={'200909009':'full'} redirect(URL(r=request,f='admin_applicant_list_3',vars=roll_type)) def admin_applicant_list_3(): rollType=request.vars return dict(rollType=rollType) On Nov 18, 10:01 am, harshit agrawal wrote: > hi, >      Wh

[web2py:35567] Dictionary as arguement in redirection

2009-11-18 Thread harshit agrawal
hi, When I am trying to redirect to a funciton with dictionary as an arguement then its showing invalid request . roll_type={'200909009':'full'} redirect(URL(r=request,f='admin_applicant_list_3',args=[roll_type])) def admin_applicant_list_3: rollType=request.args[0] return dict(rollType=rollTy

[web2py:35566] Re: web2py and postgresql

2009-11-18 Thread mdipierro
The fact is, indices must be created only once. If you have the index already that line fails. You handle the exception at the web2py level but the transcation still aborts. Try: try: db.executesql("CREATE UNIQUE INDEX indexO ON secretnum (primocod);") except: db.rollback() On Nov 18, 2:

[web2py:35565] Re: test of simple app

2009-11-18 Thread mdipierro
It was suggested it should not be the defaul behaviour to allow setting keepvalues=True for multiple inserts On Nov 18, 2:06 pm, Wes James wrote: > well, how do like that! It worked! I thought next=URL(r=request) would > be the default behavior. > > thx, > > -wes > > On Wed, Nov 18, 2009 at 12:3

[web2py:35564] Re: web2py and postgresql

2009-11-18 Thread leone
Peraphs I found the piece of code that creates the problem. After table definition I have: try: db.executesql("CREATE UNIQUE INDEX indexO ON secretnum (primocod);") except: pass if I comment these rows all runs, even if DAL and table definition is in plugin_secretnum.py On 18 Nov, 21:11,

[web2py:35563] Re: update - see values only after forcing browser to refresh

2009-11-18 Thread Wes James
That is much better. I'm using code from t3/t2 days. thx Massimo! -wes On Wed, Nov 18, 2009 at 12:52 PM, mdipierro wrote: > > Can you please try replace this: > with this: > > @auth.requires_login() > def profile(): >    form=crud.update(db.student,user_id,next=URL(r=request)) >    if form

[web2py:35562] Re: web2py and postgresql

2009-11-18 Thread leone
If I put DAL and table definition in db.py all is Ok and sql.log report: CREATE TABLE secretnum( id SERIAL PRIMARY KEY, primocod VARCHAR(8), secondocod VARCHAR(5), terzocod VARCHAR(5), username VARCHAR(20), attivo CHAR(1) ); success! If I put DAL an

[web2py:35561] Re: test of simple app

2009-11-18 Thread Wes James
well, how do like that! It worked! I thought next=URL(r=request) would be the default behavior. thx, -wes On Wed, Nov 18, 2009 at 12:31 PM, mr.freeze wrote: > > It's kind of redundant but you need to tell crud.update to redirect > back to itself using 'next': > > form=crud.update(db.student,st

[web2py:35560] Re: Internationalization

2009-11-18 Thread mdipierro
I think you found a bug. I will watch the video again. On Nov 18, 2:00 pm, szimszon wrote: > I expect a different behavior or I don't understand how translation > works :-o > > What is different if there is T.force and T.current... and no. > > If there is no T.force... just Italian language pref

[web2py:35559] Re: web2py and postgresql

2009-11-18 Thread mdipierro
what is in sql.log? On Nov 18, 10:54 am, leone wrote: > Grrr. > I can't uderstand. I have code that runs in sqlite bat non in > postgresql. > Apparently it is very simple. > Where is my error?? > > db.define_table('secretnum', >                 Field('primocod','string', length=8), >            

[web2py:35558] Re: Internationalization

2009-11-18 Thread szimszon
I expect a different behavior or I don't understand how translation works :-o What is different if there is T.force and T.current... and no. If there is no T.force... just Italian language preferred by the browser, your example text is translated to Italian and the flash messages in the top righ

[web2py:35557] Re: DAL/sql.py: patch for informix limitby

2009-11-18 Thread mdipierro
Thank you Hans, asap. Massimo On Nov 18, 12:38 pm, Hans Murx wrote: > Hi, > > afaik informix supports limiting resultsets with keword 'FIRST' since > version 9.0 and skipping (=offset) with keyword 'SKIP' since version > 10.0. The web2py default implementation 'LIMIT x OFFSET y' does not > wo

[web2py:35556] Re: update - see values only after forcing browser to refresh

2009-11-18 Thread mdipierro
Can you please try replace this: @auth.requires_login() def profile(): student=db(db.student.sid==user_id).select() if (student): form=crud.update(db.student,student[0]) else: form=crud.create(db.student) if form.errors: response.flash="There was an error s

[web2py:35555] Re: routes problems

2009-11-18 Thread mdipierro
The easiet way to make your app the default is call your app "init". Anyway, if you can use routes.py too. If you post your routes.py we can check it. On Nov 17, 10:32 am, Carlos Aboim wrote: > Hi folks, > I want to change my default page from welcome page to my app page. > > When I change the r

[web2py:35554] Re: How to do a complex migration?

2009-11-18 Thread mdipierro
Yes, I would. On Nov 18, 2:03 am, toomim wrote: > Thanks!  Would you accept a patch that makes the error messages more > obvious in these situations where you need to manually edit the > tables? > > I think ROR and Django's approaches to migrations (fully-specifying > deltas vs. maintaining stat

[web2py:35553] Re: menu_auth state

2009-11-18 Thread mdipierro
request.function=='user/register' should be request.function=='user' and request.args(0)=='register' On Nov 18, 2:00 am, annet wrote: > I menu.py I defined the following menu: > > if 'auth' in globals(): >     if not auth.is_logged_in(): >         response.menu_auth = [ >             ['Fitwi

[web2py:35552] Re: Internationalization

2009-11-18 Thread mdipierro
I do not understand the comment. Did you expect a different behavior than shown in the video or you cannot reproduce the behavior shown in the video? On Nov 18, 7:07 am, szimszon wrote: > Hm. I look at the video and, > > First time you add language "it" to the brower preferences and moved > up t

[web2py:35551] Re: KeyError: 'auth_table'

2009-11-18 Thread mdipierro
Here is the problems: auth_table=db.define_table(auth.settings.table_user_name,...) ... auth_table.username.requires= IS_NOT_IN_DB(db, 'auth_table.username') The name of the table is auth.settings.table_user_name=='auth_user'. auth_table is a local variable that reference tha table itself. In va

[web2py:35550] Re: test of simple app

2009-11-18 Thread mr.freeze
It's kind of redundant but you need to tell crud.update to redirect back to itself using 'next': form=crud.update(db.student,student[0],next=URL(r=request)) On Nov 18, 11:27 am, Wes James wrote: > pulled latest trunk > > put this in db.py > > db.define_table("student", >     SQLField("last_nam

[web2py:35549] Re: web2py and postgresql

2009-11-18 Thread leone
Strange, very strange. The code runs in db.py module but not in plugin_secretnum.py module in models. Have you notice about plugin problem? On 18 Nov, 18:19, annet wrote: > I cut and paste your code in a db.py and the default.py index function > and it ran without problem. > > I work on a Mac a

[web2py:35548] Re: web2py and postgresql

2009-11-18 Thread leone
Sob, sob... Thanks On 18 Nov, 18:19, annet wrote: > I cut and paste your code in a db.py and the default.py index function > and it ran without problem. > > I work on a Mac and use Postgres Plus 8.3 and Web2py 1.72.3 > > Kind regards, > > Annet --~--~-~--~~~---~--~---

[web2py:35547] DAL/sql.py: patch for informix limitby

2009-11-18 Thread Hans Murx
Hi, afaik informix supports limiting resultsets with keword 'FIRST' since version 9.0 and skipping (=offset) with keyword 'SKIP' since version 10.0. The web2py default implementation 'LIMIT x OFFSET y' does not work with informix! The following patch to sql.py would implement informix's behavior

[web2py:35546] Re: when is db.py parsed?

2009-11-18 Thread mr.freeze
Models are executed on every request. On Nov 18, 12:10 pm, Wes James wrote: > It seems in the past (maybe i'm wrong) that db.py was only parsed when > web2py.py was started.  Does it get parsed each time a new controller > runs now?  Can someone explain when db.py is parsed? > > thx, > > -wes --

[web2py:35545] when is db.py parsed?

2009-11-18 Thread Wes James
It seems in the past (maybe i'm wrong) that db.py was only parsed when web2py.py was started. Does it get parsed each time a new controller runs now? Can someone explain when db.py is parsed? thx, -wes --~--~-~--~~~---~--~~ You received this message because you

[web2py:35544] Re: [web2py:/] Re: Data parser advice sort from web2py developers

2009-11-18 Thread Thadeus Burgess
In any case, if Leonard moves on, the community will pick it up, since source is available. -Thadeus On Wed, Nov 18, 2009 at 10:27 AM, Carl wrote: > > Leonard Richardson: "Beautiful Soup is a hobby that I don't really > enjoy" > > I think you're right that BSoup is stable but LR isn't keen o

[web2py:35543] Re: plugin_tagging

2009-11-18 Thread Benigno
Right on, As soon as I have a user, it works. Thanks again Massimo. On Nov 18, 12:50 pm, Benigno wrote: > I am checking it this afternoon, I was logged in as admin, but hadn't > created it as a user. > > Will check again this afternoon creating a user and will let you know. > > On Nov 17, 8:38

[web2py:35542] test of simple app

2009-11-18 Thread Wes James
pulled latest trunk put this in db.py db.define_table("student", SQLField("last_name","string",length=30,default=auth.user.last_name if auth.is_logged_in() else '',requires=[IS_NOT_EMPTY()]), SQLField("first_name","string",length=30,default=auth.user.first_name if auth.is_logged_in() els

[web2py:35541] Re: web2py and postgresql

2009-11-18 Thread annet
I cut and paste your code in a db.py and the default.py index function and it ran without problem. I work on a Mac and use Postgres Plus 8.3 and Web2py 1.72.3 Kind regards, Annet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

[web2py:35540] Re: represent

2009-11-18 Thread Wes James
Ah - it's probably this in t2.itemize def represent(t,r): try: return t.represent(r) except KeyError: return '[#%i] %s' % (r.id,r[t.fields[1]]) ?? -wes On Wed, Nov 18, 2009 at 9:57 AM, Wes James wrote: > In the past, I have been able to do a represent with a ta

[web2py:35539] Re: represent

2009-11-18 Thread Wes James
In the past, I have been able to do a represent with a table. Massimo - was that a T2 only thing? -wes On Wed, Nov 18, 2009 at 9:49 AM, DenesL wrote: > > On Nov 18, 9:45 am, Wes James wrote: >> In db.py i have: >> >> db.student.represent=lambda row: TABLE(TR('yep')) > > You are missing table

[web2py:35538] web2py and postgresql

2009-11-18 Thread leone
Grrr. I can't uderstand. I have code that runs in sqlite bat non in postgresql. Apparently it is very simple. Where is my error?? db.define_table('secretnum', Field('primocod','string', length=8), Field('secondocod','string', length=5), Field('terzo

[web2py:35537] Re: represent

2009-11-18 Thread DenesL
On Nov 18, 9:45 am, Wes James wrote: > In db.py i have: > > db.student.represent=lambda row: TABLE(TR('yep')) You are missing table or field here db.table.field.represent=... > > just to see what happens with > > {{=form}} (in my previous email /app/default/profile) > > but it seems to be ignore

[web2py:/] Re: Data parser advice sort from web2py developers

2009-11-18 Thread Carl
Leonard Richardson: "Beautiful Soup is a hobby that I don't really enjoy" I think you're right that BSoup is stable but LR isn't keen on developing it further but is supporting it because it has a userbase (and he feels he should!) I have found http://scrapy.org/ that parses HTML. That might do

[web2py:35535] Re: which file is represent in?

2009-11-18 Thread Wes James
ok in tools.py there is: def update(... with form=SQLFORM() is SQLFORM supposed to use represent somewhere to form table base on db.table.represent? On Wed, Nov 18, 2009 at 9:02 AM, Wes James wrote: > I did > > find . -exec grep represent {} \; -print > > and looked in sql.py and sqlhtml.py

[web2py:35534] which file is represent in?

2009-11-18 Thread Wes James
I did find . -exec grep represent {} \; -print and looked in sql.py and sqlhtml.py but I can't locate the represent that does this: db.student.represent=lambda row: TABLE(TR(row.last_name)) where can i find it? Ok I found it in sql.py in "class Field(Expression):" Where is the "table.represe

[web2py:35533] Re: Data parser advice sort from web2py developers

2009-11-18 Thread DenesL
Oops. It seems that Python only packages for XML parsing are dying out in favor of speedier C and Python mixes. BeautifulSoup looks like the next best thing even if the developer is moving on (as you said), which might just mean that it is at a stable stage. Another plus: it has a user group aro

[web2py:35532] Re: represent

2009-11-18 Thread Wes James
I tried widget and it still shows all the fields and data. -wes On Wed, Nov 18, 2009 at 8:17 AM, mr.freeze wrote: > > Is the form readonly? What happens if you set the widget instead?: > db.student.widget=lambda row: TABLE(TR('yep')) > > On Nov 18, 8:45 am, Wes James wrote: >> In db.py i have:

[web2py:35531] Re: update - see values only after forcing browser to refresh

2009-11-18 Thread Wes James
I went back to a plain vanilla view: {{extend 'layout.html'}} {{=request.args(0)}} {{=form}} {{if request.args(0)=='login':}} register lost password {{pass}} it is does the same thing - I get the "Record Updated" flash message but then the data goes back to the original data until I refresh the

[web2py:35530] Re: represent

2009-11-18 Thread mr.freeze
Is the form readonly? What happens if you set the widget instead?: db.student.widget=lambda row: TABLE(TR('yep')) On Nov 18, 8:45 am, Wes James wrote: > In db.py i have: > > db.student.represent=lambda row: TABLE(TR('yep')) > > just to see what happens with > > {{=form}} (in my previous email /a

[web2py:35529] Re: readable=False fields displayed.

2009-11-18 Thread annet
Denes, > Hope this helps, Yes, thanks. I thought that when I'd set writable=False I wouldn't be able to do: db.nfa.bedrijf.default=auth.user.bedrijf ... but I am, so, problem solved. Kind regards, Annet. --~--~-~--~~~---~--~~ You received this message becaus

[web2py:35528] Re: Data parser advice sort from web2py developers

2009-11-18 Thread Carl
I saw those postings and checked out lxml. alas lxml is built with some C libraries that aren't available on GAE. On Nov 18, 2:10 pm, DenesL wrote: > lxml has been recommended around here > before:http://codespeak.net/lxml/parsing.html --~--~-~--~~~---~--~~ You r

[web2py:35527] represent

2009-11-18 Thread Wes James
In db.py i have: db.student.represent=lambda row: TABLE(TR('yep')) just to see what happens with {{=form}} (in my previous email /app/default/profile) but it seems to be ignored. Any idea why? I put a break point in there in wingide and it seems to process the line. thx, -wes --~--~--

[web2py:35526] Re: update - see values only after forcing browser to refresh

2009-11-18 Thread Wes James
in the controller: @auth.requires_login() def profile(): student=db(db.student.sid==user_id).select() if (student): form=crud.update(db.student,student[0]) else: form=crud.create(db.student) if form.errors: response.flash="There was an error submitting the

[web2py:35525] Re: break label in sqlfield

2009-11-18 Thread Wes James
works now - thx On Wed, Nov 18, 2009 at 5:34 AM, mdipierro wrote: > > It is a bug. fixing in trunk. > > On Nov 17, 11:04 pm, Wes James wrote: >> On Tue, Nov 17, 2009 at 9:56 PM, mdipierro wrote: >> >> > label=XML('texttext') >> >> this is what I did (above) - is just has it as if there were no

[web2py:35524] Re: readable=False fields displayed.

2009-11-18 Thread DenesL
Annet, db.table.field.readable=False means don't show field in display (output) forms db.table.field.writable=False means don't show field in create/edit (input) forms Hope this helps, Denes. --~--~-~--~~~---~--~~ You received this message because you are subscri

[web2py:35523] New features not documented in book 2 ed. (rev.2)

2009-11-18 Thread DenesL
New features not documented in book 2nd edition decimal field type http://groups.google.com/group/web2py/browse_thread/thread/3c1957d8ed743513 1.72.1 * Alias for id field allows to redefine the name of the 'id' field. * make_migrate=True rebuild missing .table files http://groups.google.com

[web2py:35522] Re: Data parser advice sort from web2py developers

2009-11-18 Thread DenesL
lxml has been recommended around here before: http://codespeak.net/lxml/parsing.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com

[web2py:35521] Re: Internationalization

2009-11-18 Thread szimszon
Hm. I look at the video and, First time you add language "it" to the brower preferences and moved up then the flash is translated to Italian in the web page. But after the T.force thing and Italian was the browser preferred one the flash was in English... On Nov 18, 1:29 am, mdipierro wrote: >

[web2py:35520] Re: update - see values only after forcing browser to refresh

2009-11-18 Thread selecta
i have part of the solution but a followup problem so when you update the form is already created before the update, thus if you do not update the from afterwards it shows still with the old values to fix this i wrote movie_form=SQLFORM(db.movie,12) if movie_form.accepts(request.vars):

[web2py:35519] Re: Retrieve Images From Database

2009-11-18 Thread mdipierro
what do you mean by "calling"? The garbage is the image. On Nov 17, 11:39 pm, David wrote: > I was storing the images in postgres.  When I tried calling the image > by the filename it returned the coded filename.  When I tried calling > the image blob it returned garbage. > > I was just wonderin

[web2py:35518] Re: update - see values only after forcing browser to refresh

2009-11-18 Thread mdipierro
Cannot say without looking at the entire action. On Nov 17, 11:35 pm, Wes James wrote: > I have this: > >     student=db(db.student.sid==user_id).select() >     if (student): >         form=crud.update(db.student,student[0]) >     else: >         form=crud.create(db.student) > > But when I do a

[web2py:35517] Re: break label in sqlfield

2009-11-18 Thread mdipierro
It is a bug. fixing in trunk. On Nov 17, 11:04 pm, Wes James wrote: > On Tue, Nov 17, 2009 at 9:56 PM, mdipierro wrote: > > > label=XML('texttext') > > this is what I did (above) - is just has it as if there were no XML() > > > > > or > > > label=SPAN('text',BR(),'text') > > > On Nov 17, 9:31 p

[web2py:35516] Re: RSS encoding

2009-11-18 Thread mdipierro
oops. Thanks. On Nov 17, 10:58 pm, Alexey Nezhdanov wrote: > Hello. I noticed that generic.rss produces non utf-8 text. Even worse - it > produces iso-8859-1 text WITHOUT AN OPTION TO CHANGE THAT! > > So I made the following change to gluon/contrib/rss2.py : > > def dumps(rss, encoding='utf-8'):

[web2py:35515] Re: readable=False fields displayed.

2009-11-18 Thread moriarty
I set readable and writable to False when i want to hide a field on the form. You also need to set a default value if required is True. On Nov 18, 6:12 am, annet wrote: > I defined the following custom auth_user table: > > auth.settings.table_user=db.define_table('auth_user', >     Field('bedrij

[web2py:35514] Data parser advice sort from web2py developers

2009-11-18 Thread Carl
hi, I have some markdown chunks of data. I'm either going to join them together with more markdown or with XML (this scaffolding will also hold some additional meta data). I'm running on GAE and looking for a suitable XML parser to use. I was get all excited by lxml (http://codespeak.net/lxml/)

[web2py:35513] Re: plugin_tagging

2009-11-18 Thread Benigno
I am checking it this afternoon, I was logged in as admin, but hadn't created it as a user. Will check again this afternoon creating a user and will let you know. On Nov 17, 8:38 pm, mdipierro wrote: > the plugin requires a logged in user. Do you have an acount with the > app and are you logged

[web2py:35512] crud.select headers attribute

2009-11-18 Thread annet
I have the following function: records=crud.select(db.nfa, query=((db.nfa.bedrijf==auth.user.bedrijf)& (db.nfa.nfatype==db.nfatype.id)),\ fields=['nfatype.nfatype','nfa.adres'], orderby='nfa.nfatype', headers={'nfatype.nfatype', 'medium', 'nfa.adres', 'adres'}) When I remove the headers att

[web2py:35511] crud.update(...,message,...)

2009-11-18 Thread annet
In a controller I have the following function: def update_company(): response.view='company/update.html' response.flash='Update bedrijfsgegevens' form=update_form (db.bedrijf,company_id,'update_company','Bedrijfsgegevens gewijzigd',False) return dict(form=form) I defined the upd

[web2py:35510] readable=False fields displayed.

2009-11-18 Thread annet
I defined the following custom auth_user table: auth.settings.table_user=db.define_table('auth_user', Field('bedrijf', db.bedrijf, default='', notnull=True,ondelete='CASCADE', readable=False), Field('first_name', length=128, default='', notnull=True), Field('last_name', length=128, de

[web2py:35509] Re: How to do a complex migration?

2009-11-18 Thread toomim
Thanks! Would you accept a patch that makes the error messages more obvious in these situations where you need to manually edit the tables? I think ROR and Django's approaches to migrations (fully-specifying deltas vs. maintaining static schemas) are both more burdensome than web2py's system of

[web2py:35508] menu_auth state

2009-11-18 Thread annet
I menu.py I defined the following menu: if 'auth' in globals(): if not auth.is_logged_in(): response.menu_auth = [ ['Fitwise CMS',request.function=='index',URL (r=request,c='default',f='index')], ['Login',request.function=='user/login',URL (r=request,c='default