[web2py] Re: crud delete_record checkbox [RESOLVED]

2010-01-29 Thread mdipierro
Why do you want to put this in sqlhtml? In you controller you can do: form.custom.label['deletable'] = 'delete_label' On Jan 30, 12:53 am, weheh wrote: > Yes, I see that. But URGH, do I really want to start leaving > footprints in gluon? What happens when there's a new release. Do they > get wi

[web2py] Re: user profile form

2010-01-29 Thread mdipierro
yes or in models if not too long On Jan 30, 12:48 am, weheh wrote: > Would I put this class extension in the modules folder? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsub

[web2py] Re: auth membership

2010-01-29 Thread mdipierro
auth.has_membership(auth.id_group('Member'),auth.user.id): On Jan 30, 12:41 am, weheh wrote: > What's the most concise syntax to find out if a user belongs to a > group called "paying_member"? > > From the looks of it, it seems like I'd have to do something like > this: > >     group_id=db(db.aut

[web2py] Re: crud delete_record checkbox [RESOLVED]

2010-01-29 Thread weheh
Yes, I see that. But URGH, do I really want to start leaving footprints in gluon? What happens when there's a new release. Do they get wiped out and then I have to do it over again? Seems like the deletable field label should be a permanent fixture, no? -- You received this message because you ar

[web2py] Re: user profile form

2010-01-29 Thread weheh
Would I put this class extension in the modules folder? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.

[web2py] auth membership

2010-01-29 Thread weheh
What's the most concise syntax to find out if a user belongs to a group called "paying_member"? >From the looks of it, it seems like I'd have to do something like this: group_id=db(db.auth_group.role=='Member').select()[0].id if auth.has_membership(group_id,auth.user.id): redirect(U

[web2py] Re: user profile form

2010-01-29 Thread mdipierro
I would extend Auth and redefine the profile method so that it returns a custom form. class MyAuth(Auth): def profile(): pass On Jan 30, 12:08 am, weheh wrote: > I'm building an app where anyone from the general public can join and > gain access to some of the site's functionality, while

[web2py] Re: has anybody check the the cron in trunk?

2010-01-29 Thread mdipierro
Would this path be right c:/Python25/python.exe or this c:\Python25\python.exe or both? On Jan 29, 11:18 pm, "mr.freeze" wrote: > No but I'm getting this in the console on Windows 7:>>> WARNING:root:WEB2PY > CRON Call returned code 1: > > 'c:/Python25/python.exe\' is not recognized as an int

[web2py] Re: crud delete_record checkbox [RESOLVED]

2010-01-29 Thread mr.freeze
I don't think it's in there. You would need to add this at line 676 of sqlhtml.py: self.custom.label['deletable'] = delete_label On Jan 29, 11:58 pm, weheh wrote: > I'm not sure I understood what you wrote, sorry. My question, really, > is what is the name of the key used to access the delete lab

[web2py] user profile form

2010-01-29 Thread weheh
I'm building an app where anyone from the general public can join and gain access to some of the site's functionality, while paying members gain access to more functionality. Pretty typical. Since I expect lots more non-paying members than paying members, I don't want to clutter up auth_user with a

[web2py] Re: crud delete_record checkbox [RESOLVED]

2010-01-29 Thread weheh
I'm not sure I understood what you wrote, sorry. My question, really, is what is the name of the key used to access the delete label in form.custom.label[''] ='delete_label' doesn't work. ='deletable' doesn't work, either. -- You received this message because you are subscribed to th

[web2py] Re: crud delete_record checkbox [RESOLVED]

2010-01-29 Thread mdipierro
form = SQLFORM(,delete_label='') or (works for crud too) form.element(_for=form.FIELDKEY_DELETE_RECORD)[0]='delete label' On Jan 29, 10:42 pm, weheh wrote: > Massimo, does it have a label? -- You received this message because you are subscribed to the Google Groups "web2py-users" gr

[web2py] Re: has anybody check the the cron in trunk?

2010-01-29 Thread mr.freeze
No but I'm getting this in the console on Windows 7: >>> WARNING:root:WEB2PY CRON Call returned code 1: 'c:/Python25/python.exe\' is not recognized as an internal or external command, operable program or batch file. On Jan 29, 5:37 pm, mdipierro wrote: > In particular on windows and the @reboot o

[web2py] Re: Using XML templates with AMF

2010-01-29 Thread Dane
Great, nice and simple. Thanks. On Jan 29, 9:52 pm, Thadeus Burgess wrote: > @service.amfrpc3('domain') > def somefunction(param): >    return response.render(filename='mytemplate.xml', context=dict(items)) > > -Thadeus > > On Fri, Jan 29, 2010 at 8:28 PM, Dane wrote: > > Yes, I'm using services

[web2py] Re: crud delete_record checkbox [RESOLVED]

2010-01-29 Thread weheh
Massimo, does it have a label? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, vi

[web2py] Re: crud delete_record checkbox [RESOLVED]

2010-01-29 Thread weheh
It works. Thanks. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this grou

Re: [web2py] Re: Using XML templates with AMF

2010-01-29 Thread Thadeus Burgess
@service.amfrpc3('domain') def somefunction(param): return response.render(filename='mytemplate.xml', context=dict(items)) -Thadeus On Fri, Jan 29, 2010 at 8:28 PM, Dane wrote: > Yes, I'm using services currently. My question is how do I return xml > generated by a template THROUGH a serv

[web2py] Re: Using XML templates with AMF

2010-01-29 Thread Dane
Yes, I'm using services currently. My question is how do I return xml generated by a template THROUGH a service. Sorry if I'm unclear or out in left field. I'm still a beginner. The idea is something like this: @service.amfrpc3('domain') def somefunction(param): return dict(items = db(db.ite

[web2py] Re: Using XML templates with AMF

2010-01-29 Thread mdipierro
Did you look into web2py services? @service.amfrpc3('domain') def somefunction(a,b,c): return a+b+c On Jan 29, 5:44 pm, Dane wrote: > Hello, > > I'm building a web2py backend for a Flex site, and I would like to > send some of my data as XML since it's hierarchical in nature and AS3 > ha

[web2py] Re: Using XML templates with AMF

2010-01-29 Thread Dane
Also note I'm running on GAE, in case that makes a difference. On Jan 29, 6:44 pm, Dane wrote: > Hello, > > I'm building a web2py backend for a Flex site, and I would like to > send some of my data as XML since it's hierarchical in nature and AS3 > has great xml manipulation capabilities with e4x

[web2py] Using XML templates with AMF

2010-01-29 Thread Dane
Hello, I'm building a web2py backend for a Flex site, and I would like to send some of my data as XML since it's hierarchical in nature and AS3 has great xml manipulation capabilities with e4x. However, I'd like to send this data through an exposed amf function instead of through REST for speed, s

[web2py] has anybody check the the cron in trunk?

2010-01-29 Thread mdipierro
In particular on windows and the @reboot option? Massimo -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroup

Re: [web2py] Postgres Log Shipping

2010-01-29 Thread Thadeus Burgess
Yes google is great. I can find most anything I want with google. I was looking for if anyone knew any good tutorials that might have been missed by google. Thanks though. -Thadeus On Fri, Jan 29, 2010 at 3:36 PM, Johann Spies wrote: > On 29 January 2010 22:50, Thadeus Burgess wrote: >> C

[web2py] Re: crud delete_record checkbox

2010-01-29 Thread mdipierro
I think {{=form.custom.deletable}} On Jan 29, 4:07 pm, weheh wrote: > How to get the delete_record field to show on a custom form? > > I tried variants of form.custom.label['delete_record'] and > form.custom.widget.delete_record in the case where controller has > crud.update(...,deletable=True)

[web2py] Re: get or insert shortcut

2010-01-29 Thread Richard
Would these shortcuts belong in the DAL or a plugin? > db(logic).count() > since you do not need the record. You just need to know if it exists. I also need to know its ID. On Jan 30, 1:57 am, mdipierro wrote: > On Jan 28, 11:06 pm, Richard wrote: > > > thanks that's much neater. > > > > doe

[web2py] Re: Stupid translation question

2010-01-29 Thread Christopher Steel
I noticed an inconsistencies though, in particular T.current_languages can hold more than one value so my description was not entirely accurate, not sure if anyone else has a better explaination... In the mean time here is a link to a working multilingual scaffold that people can download and add

[web2py] crud delete_record checkbox

2010-01-29 Thread weheh
How to get the delete_record field to show on a custom form? I tried variants of form.custom.label['delete_record'] and form.custom.widget.delete_record in the case where controller has crud.update(...,deletable=True) -- You received this message because you are subscribed to the Google Groups

Re: [web2py] response.postprocessing

2010-01-29 Thread Thadeus Burgess
bah I need to take a break, my eyes play tricks on me. -Thadeus On Fri, Jan 29, 2010 at 3:35 PM, Thadeus Burgess wrote: > Why does this function get a dictionary, when this is the only > function in postprocessing > > def compress_response(xml): >    print xml # prints {'form': } >    cpat =

[web2py] Re: crud newbie question regarding update [ALMOST THERE]

2010-01-29 Thread weheh
OK, I see the problem. The .id link created by crud.select points to the default controller. I need it to point to admin. What's the method for informing crud to do that? Obviously, I can do a redirect, but that seems kludgy. Why wouldn't crud.select automatically set the controller to be the same

Re: [web2py] response.postprocessing

2010-01-29 Thread Thadeus Burgess
Why does this function get a dictionary, when this is the only function in postprocessing def compress_response(xml): print xml # prints {'form': } cpat = re.compile(r'[\n\t\r\f\v]|(?s)\s\s\s|(?s)|(?s)|(?s)') d = cpat.sub(save_pre, xml) return d response.postprocessing.append(com

Re: [web2py] Postgres Log Shipping

2010-01-29 Thread Johann Spies
On 29 January 2010 22:50, Thadeus Burgess wrote: > Can anyone suggest a tutorial for log shipping to another database > using postgresql ? If you mean by "log shipping" the method of using logs of sql-transactions to duplicate a database on another server you can search for "postgresql warm stand

Re: [web2py] Re: ProgrammingError: there is no unique constraint matching given keys for referenced table "scopus_rou"

2010-01-29 Thread Johann Spies
On 29 January 2010 23:24, Johann Spies wrote: > On 29 January 2010 22:33, mdipierro wrote: >> can we see the definition of db.scopus_rou? What database engine? Your question helped me to remember: This was the table I recreated through psql then web2py did not change the field type (the other t

Re: [web2py] response.postprocessing

2010-01-29 Thread Thadeus Burgess
Thanks. grep fail :) -Thadeus On Fri, Jan 29, 2010 at 3:22 PM, Jonathan Lundell wrote: > On Jan 29, 2010, at 1:16 PM, Thadeus Burgess wrote: > >> Maybe its just me and I need to look harder >> >> but I can't find where web2py calls this... at all > > run_controller_in() (in compileapp.py) >

Re: [web2py] Re: ProgrammingError: there is no unique constraint matching given keys for referenced table "scopus_rou"

2010-01-29 Thread Johann Spies
On 29 January 2010 22:33, mdipierro wrote: > can we see the definition of db.scopus_rou? What database engine? Database Engine: Postgresql. Here is the definition for scopus_rou: db.define_table("scopus_rou", Field("Authors", 'text'), Field("Title", "string", len

Re: [web2py] response.postprocessing

2010-01-29 Thread Jonathan Lundell
On Jan 29, 2010, at 1:16 PM, Thadeus Burgess wrote: > Maybe its just me and I need to look harder > > but I can't find where web2py calls this... at all run_controller_in() (in compileapp.py) -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To

[web2py] response.postprocessing

2010-01-29 Thread Thadeus Burgess
Maybe its just me and I need to look harder but I can't find where web2py calls this... at all -Thadeus -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this grou

[web2py] Postgres Log Shipping

2010-01-29 Thread Thadeus Burgess
Can anyone suggest a tutorial for log shipping to another database using postgresql ? -Thadeus -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send em

Re: [web2py] clean in admin

2010-01-29 Thread Wes James
ah - makes sense. thx, -wes On Fri, Jan 29, 2010 at 1:14 PM, Jason Brower wrote: > Yup.  It's cleared your login session. :)  So no one, including you in > logged in. :D > BR, > Jason > On Fri, 2010-01-29 at 09:44 -0700, Wes James wrote: >> When I click on clean in admin it takes me to the admi

[web2py] Re: ProgrammingError: there is no unique constraint matching given keys for referenced table "scopus_rou"

2010-01-29 Thread mdipierro
can we see the definition of db.scopus_rou? What database engine? On Jan 29, 1:00 pm, Johann Spies wrote: > The data of the following table will come from 4 other: > (db.scopus_rou, db.cab_rou, db.pubmed_rou, db.wos_rou) > > In each record I want to indicate from which of those the data of that >

[web2py] Re: routes.py SUCKS [or not]

2010-01-29 Thread mdipierro
This route alone routes_in=[ ('/w2p/', '/myapp/default/index')] should map that url into /myapp/default/index. does it work? On Jan 29, 12:01 pm, Tamas wrote: > The URL ishttp://example.com/w2p/the app's name is myapp apparently. > > On Jan 29, 6:53 pm, mdipierro wrote: > > > what is the URL y

Re: [web2py] clean in admin

2010-01-29 Thread Jason Brower
Yup. It's cleared your login session. :) So no one, including you in logged in. :D BR, Jason On Fri, 2010-01-29 at 09:44 -0700, Wes James wrote: > When I click on clean in admin it takes me to the admin login page > > w2p 1.74.8 > > -wes > -- You received this message because you are

[web2py] ProgrammingError: there is no unique constraint matching given keys for referenced table "scopus_rou"

2010-01-29 Thread Johann Spies
The data of the following table will come from 4 other: (db.scopus_rou, db.cab_rou, db.pubmed_rou, db.wos_rou) In each record I want to indicate from which of those the data of that record came. The last four fields are supposed to do that. In each case at least three of them might be empty. Now

[web2py] Re: crud newbie question regarding update [ALMOST THERE]

2010-01-29 Thread weheh
On Jan 29, 1:40 pm, weheh wrote: > OK, I see the problem. The .id link created by crud.select points to > the default controller. I need it to point to admin. What's the method > for informing crud to do that? Obviously, I can do a redirect, but > that seems kludgy. Why wouldn't crud.select auto

[web2py] Re: crud newbie question regarding update

2010-01-29 Thread weheh
OK, I see the problem. The .id link created by crud.select points to the default controller. I need it to point to admin. What's the method for informing crud to do that? Obviously, I can do a redirect, but that seems kludgy. Why wouldn't crud.select automatically set the controller to be the same

[web2py] Re: routes.py SUCKS [or not]

2010-01-29 Thread Tamas
The URL is http://example.com/w2p/ the app's name is myapp apparently. On Jan 29, 6:53 pm, mdipierro wrote: > what is the URL you see in your browser when you get the error? > what is your app name? > > On Jan 29, 11:50 am, Tamas wrote: > > > Hi, > > > I tried > > > routes_in=[ ('/w2p/?', '/myap

[web2py] Re: routes.py SUCKS [or not]

2010-01-29 Thread mdipierro
what is the URL you see in your browser when you get the error? what is your app name? On Jan 29, 11:50 am, Tamas wrote: > Hi, > > I tried > > routes_in=[ ('/w2p/?', '/myapp'), ('/w2p/(?P.*)$','/\g')] > > but it does not work, I still get the unknown ticket. > > On Jan 29, 6:46 pm, mdipierro wro

[web2py] Re: routes.py SUCKS [or not]

2010-01-29 Thread Tamas
Hi, I tried routes_in=[ ('/w2p/?', '/myapp'), ('/w2p/(?P.*)$','/\g')] but it does not work, I still get the unknown ticket. On Jan 29, 6:46 pm, mdipierro wrote: > Because your app is not called 'init' and we assumed it was. This will > fix it. > > routes_in=[('/w2p/?','/youappname'),('/w2p/$a

[web2py] Re: routes.py SUCKS [or not]

2010-01-29 Thread mdipierro
Because your app is not called 'init' and we assumed it was. This will fix it. routes_in=[('/w2p/?','/youappname'),('/w2p/$anything','/$anything')] routes_out=[('/$anything','/w2p/$anything')] On Jan 29, 11:41 am, Tamas wrote: > Thanks, based on your suggestion this works: > > routes_in=[('/w2p/

[web2py] Re: routes.py SUCKS

2010-01-29 Thread Tamas
Thanks, based on your suggestion this works: routes_in=[('/w2p/(?P.*)$','/\g')] routes_out=[('/(?P.*)$','/w2p/\g')] However, I still have the problem of getting an unknown ticket for plain /w2p/ (default apps are not installed), how can I specify which application should it go by default? On Ja

[web2py] Re: routes.py SUCKS

2010-01-29 Thread mdipierro
routes_in=[('/w2p/$anything','/$anything')] routes_out=[('/$anything','/w2p/$anything')] On Jan 29, 11:17 am, Tamas wrote: > Hello, > > I would like to tackle the simple task of running web2py on a folder > of the website, say > > http://example.org/w2p/ > > So that an application will be > li

[web2py] Re: Strange ticket

2010-01-29 Thread mdipierro
Could it be some kind of port scan causing it? At my office for example they do port cans every week. On Jan 29, 11:26 am, Thadeus Burgess wrote: > http > > ubuntu 8.10 > > apache2 > > mod_wsgi > > python 2.6 > > The thing is, the ticket is issued when clients visit the website, I > cannot reprod

Re: [web2py] routes.py SUCKS

2010-01-29 Thread Thadeus Burgess
routes_in ('^/admin(?P.*)', '/admin\g'), ('^/appadmin(?P.*)', '/init/appadmin\g'), ('^/(?P.*)', '/init/default/\g'), routes_out ('/init/appadmin(?P.*)', '/appadmin\g'), ('/init/default(?P.*)', '/default\g'), -Thadeus On Fri, Jan 29, 2010 at 11:24 AM

Re: [web2py] Re: Strange ticket

2010-01-29 Thread Thadeus Burgess
http ubuntu 8.10 apache2 mod_wsgi python 2.6 The thing is, the ticket is issued when clients visit the website, I cannot reproduce the error, so I have no clue what "action" causes this. It only happens once in a blue moon (meaning once maybe every 2-5 days). It happens during the day and nigh

Re: [web2py] routes.py SUCKS

2010-01-29 Thread Jonathan Lundell
On Jan 29, 2010, at 9:17 AM, Tamas wrote: > I would like to tackle the simple task of running web2py on a folder > of the website, say > > http://example.org/w2p/ > > So that an application will be like > http://example.org/w2p/example/default/index > > Setting up the WSGI handler is easy, how

[web2py] routes.py SUCKS

2010-01-29 Thread Tamas
Hello, I would like to tackle the simple task of running web2py on a folder of the website, say http://example.org/w2p/ So that an application will be like http://example.org/w2p/example/default/index Setting up the WSGI handler is easy, however routes.py gives me a hard time. I tried a bunch o

[web2py] Re: Strange ticket

2010-01-29 Thread mdipierro
It his over https with wsgiserver? On Jan 29, 10:56 am, Thadeus Burgess wrote: > Every once in a while I get the following ticket. Its random, any ideas? > > Traceback (most recent call last): >   File "gluon/main.py", line 396, in wsgibase >     request.body = copystream_progress(request) ### st

[web2py] Re: Strange ticket

2010-01-29 Thread mdipierro
What's you settings? os? web2py? python? server? On Jan 29, 10:56 am, Thadeus Burgess wrote: > Every once in a while I get the following ticket. Its random, any ideas? > > Traceback (most recent call last): >   File "gluon/main.py", line 396, in wsgibase >     request.body = copystream_progress(r

[web2py] Strange ticket

2010-01-29 Thread Thadeus Burgess
Every once in a while I get the following ticket. Its random, any ideas? Traceback (most recent call last): File "gluon/main.py", line 396, in wsgibase request.body = copystream_progress(request) ### stores request body File "gluon/main.py", line 143, in copystream_progress copystream(

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread mdipierro
I think the point is: is it better to generate a validation error message when a choice is not selected or, by default, select always the first choice? Are you sure that the problem is with the presence of a blank option and not with the wrong error associated to it? On Jan 29, 9:55 am, Thadeus Bu

[web2py] clean in admin

2010-01-29 Thread Wes James
When I click on clean in admin it takes me to the admin login page w2p 1.74.8 -wes -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to

[web2py] Re: Decode field in one to many relation

2010-01-29 Thread DenesL
I see two ways: 1) Using a left join rows==db(db.Customer_storage.Customer_id==id_customer).select (db.Customer_storage.ALL,db.Storage.Model,left=db.Storage.on (db.Customer_storage.Object_id==db.Storage.id),orderby=db.Customer_storage.Object_id) so now rows includes a Storage.Model column 2) In

Re: [web2py] Re: format zero IS_IN_DB

2010-01-29 Thread Thadeus Burgess
+1 supporting DenesL argument. (but we already know this) note. default. breaks app. we like the feature but it shouldn't break an app no reason to have to specifically DISABLE something that hasn't existed in web2py before ( you know, the empty select or "please choose a value" breaks my app

Re: [web2py] Re: format zero IS_IN_DB

2010-01-29 Thread Jonathan Lundell
Yes, the option is important. But the case for a default of None is pretty convincing. On 1/29/10, mdipierro wrote: > Let's hear a few more opinions. I don't just want to say no. The > problem is that we had this discussion already and people insisted > such option should be there. > > Massimo >

[web2py] Re: plug-in webfolder

2010-01-29 Thread mdipierro
I do not understand: Field('parent', 'integer', default=0, requires = IS_IN_DB (db,'plugin_webfolder_files.id','%(name)s')) Why this is interger and not a reference. Why a default value that would not pass validation? Why not this: Field('parent', 'reference plugin_webfolder_files', default=None

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread mdipierro
Let's hear a few more opinions. I don't just want to say no. The problem is that we had this discussion already and people insisted such option should be there. Massimo On Jan 29, 9:31 am, DenesL wrote: > I must insist. > The point is that IS_IN_DB and IS_IN_SET now show a spurious empty > optio

[web2py] Re: plug-in webfolder

2010-01-29 Thread selecta
maybe it is also a mistake to state default=0 try with default=None or without the default value On Jan 29, 4:19 pm, selecta wrote: > guess this has something to do with how i define the table > i would guess this line does not work > Field('parent', 'reference plugin_webfolder_files', default=0,

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread DenesL
I must insist. The point is that IS_IN_DB and IS_IN_SET now show a spurious empty option by default. The keyword here is default. If you want to introduce a 'choose a value" option you should do it explicitly and 'at your own risk', the risk being that it creates an option that when selected will

[web2py] Re: plug-in webfolder

2010-01-29 Thread selecta
guess this has something to do with how i define the table i would guess this line does not work Field('parent', 'reference plugin_webfolder_files', default=0, requires = IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s')) you can exchange it with Field('parent', 'integer', default=0, requires = I

[web2py] Re: help to make a complex model

2010-01-29 Thread mdipierro
P.S. Instead of compute=lambda row: double(row['human_cost'])*double(row ['external_cost']) this should work too compute=lambda row: row['human_cost']*row['external_cost'] not sure, but let us know. On Jan 29, 9:03 am, mdipierro wrote: > db.define_table('product cost', >         Field('quo

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread mdipierro
There is no way to please everybody here. some people ask for zero=None, some for zero='', some for zero='Please choose a value'. There is no right or wrong. I think we should leave the default as is ('', we changed it twice already) and you configure it as needed. Massimo On Jan 29, 9:00 am, Den

[web2py] Re: help to make a complex model

2010-01-29 Thread mdipierro
db.define_table('product cost', Field('quote_products_id', db.quote_products, requires=IS_IN_DB (db, 'quote_products.id', lambda row: row.product.description')), Field('quote_products_id', db.quote_products, requires=IS_IN_DB (db, 'quote_products.id', 'quote_products.product')),

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread DenesL
-- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://grou

[web2py] Re: library app

2010-01-29 Thread mdipierro
You need to upgrade web2py. On Jan 29, 3:59 am, Mengu wrote: > i have downloaded the latest web2py and the source. after i import the > app, i got this error: > > Traceback (most recent call last): >   File "/home/mengu/projects/web2py/gluon/restricted.py", line 184, in > restricted >     exec cc

[web2py] Re: get or insert shortcut

2010-01-29 Thread mdipierro
On Jan 28, 11:06 pm, Richard wrote: > thanks that's much neater. > > > does not do what you think it does. > > can you explain? It worked for my test cases... You were right. It just looked wrong at a quick look. Sorry I would have looked in more detail. > > record = db(logic).select(table['id']

[web2py] Re: Translations stopped working in 1.74.8

2010-01-29 Thread mdipierro
You did find a major bug. For now it is a fixed in trunk. Please give it a try. You do not need T.force unless your primary language (the one that does not need trsnalation) is not english. In thi case you should do T.current_languages=['pl', 'pl-pl'] T.force(T.http_accept_language) or simply T

[web2py] Re: new to web2py, simple question about def return dict

2010-01-29 Thread DenesL
Hi candide and welcome aboard, returning a dict from a web2py function means that you want to call a view with the same name to render the output, as opposed to returning a string which will be the final output. In your views you can use the dict keys as variables to display information, for exam

Re: [web2py] New site in web2py

2010-01-29 Thread Jason Brower
I think those are tango icons, they are public domain. On Fri, 2010-01-29 at 12:50 +, Miguel Lopes wrote: > There's some problem with the "noticia" view since the html of the > news body is rendering as text. > > > Congratulations on the site. Nice icon set. Is it opensource / free? > > >

[web2py] Decode field in one to many relation

2010-01-29 Thread ceriox
hi all, i don't know how to decode the field in one to many relation when i show "rows" i want to decode Customer_storage.Object_id whit Storage.Model for shwo to user a table like this: Object Serial number Serial number sostituitoGaranzia Note ACME12323s332

Re: [web2py] Re: wmd

2010-01-29 Thread Johann Spies
Thanks! Johann -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group

Re: [web2py] new to web2py, simple question about def return dict

2010-01-29 Thread tyoc 213
Dictionaries are 'dict' data types, that means key=value set of pairs so is easy to know always the name of a var and the value of the var... If I understand correctly this dictionary is "exploted" to the view... I mean it's key value pairs are populated to the view for access them directly, some

[web2py] new to web2py, simple question about def return dict

2010-01-29 Thread candide2023
hi, I am new here, in python and web2py as well. I was thinking about to get involved in web programming, I started with php (studied about 2 weeks) and then tried django (about 1 day) and now web2py(about 2 weeks) I am going through the manual. Anyways, there is one poing that I didnt get. Why do

[web2py] Re: New site in web2py

2010-01-29 Thread Leandro - ProfessionalIT
Hello Miguel, > There's some problem with the "noticia" view since the html of the news body > is rendering as text. Thanks, I forget of XML() function in this page. > Congratulations on the site. Thank you. Some details I still have to review and another ideas to a second moment, as comment in

[web2py] Re: plug-in webfolder

2010-01-29 Thread leone
Using postgres i debug IntegrityError: insert or update on table "plugin_webfolder_files" violates foreign key constraint "plugin_webfolder_files_parent_fkey" DETAIL: Key (parent)=(0) is not present in table "plugin_webfolder_files". Have you a suggest? On 29 Gen, 10:38, selecta wrote: > Here is

Re: [web2py] New site in web2py

2010-01-29 Thread Miguel Lopes
There's some problem with the "noticia" view since the html of the news body is rendering as text. Congratulations on the site. Nice icon set. Is it opensource / free? Miguel -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this grou

[web2py] help to make a complex model

2010-01-29 Thread Leandro - ProfessionalIT
Friends, I have this situation: My customers quote products and all products in the quote has a separated cost. The sum of all cost for all products of a quote is the price of product for this customer. To map this scenario, I have these tables: a) customer: db.define_table('customer',

Re: [web2py] Re: Form not working....

2010-01-29 Thread Jason Brower
Ok I think I got it... I needed to check if it was accepted before it would take it... so I added after the form = bla bla if form.accepts(request.vars, session): response.flash="New order added" And it works perfectly. Thanks for the help!! BR, Jason Brower On Fri, 2010-01-29 at 01:00 -0800,

[web2py] Re: library app

2010-01-29 Thread Mengu
i have downloaded the latest web2py and the source. after i import the app, i got this error: Traceback (most recent call last): File "/home/mengu/projects/web2py/gluon/restricted.py", line 184, in restricted exec ccode in environment File "/home/mengu/projects/web2py/applications/library/

[web2py] Re: screencast requests

2010-01-29 Thread Mengu
massimo, i can happily do this. dear alex, i have never worked with iphone or android so i cannot help with those. i'm sorry. On Jan 29, 12:43 am, mdipierro wrote: > Since I just make thishttp://www.web2py.com/library > It would be nice to make a screencast that goes over the source code > lin

[web2py] Re: get or insert shortcut

2010-01-29 Thread selecta
nice work Richard, can you create a plug-in with the code in a model module e.g. model/plugin_dalhelper.py this would make it easy for me an others to install use and improve (if there is still a need for it) your code also if you write updates I guess i could just reinstall the plug-in and have an

[web2py] Re: Translations stopped working in 1.74.8

2010-01-29 Thread ls1
Massimo, in this case it doesn't matter in which language my app is written. I'm talking about 'welcome' and 'admin' applications which comes with web2py. Current behavior is following: If I set only one language in web browser preferences everything goes ok. That means if I set 'es-es' I receive s

[web2py] plug-in webfolder

2010-01-29 Thread selecta
Here is a webfolder plug-in. It is still quite raw. http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.plugin.webfolder.w2p Feel free to use and improve it. It depends on an improved IS_IN_SET validator. To use the plug-in you need to replace the constructor of IS_IN_SET (gluon/validators.py) wit

[web2py] Re: Form not working....

2010-01-29 Thread pistacchio
hi jason, by writing orders = SQLFORM(db.numbers) you are assigning to the variable "orders" the form. in the following line you return form=form, but the latter is a null object. so, either you change the name of the variable like this: form = SQLFORM(db.numbers) return dict(form=form) {{=form}

[web2py] Form not working....

2010-01-29 Thread Jason Brower
I have this in the end of my controller... orders = SQLFORM(db.numbers) return dict(form=form) And I simply print it with the view... {{=form}} In that view I use ajax pulls that look for new content in orders and print it on that same page. (I need it so that other people on other browsers can a