[web2py] SyntaxWarning: import * only allowed at module level

2013-03-18 Thread Annet
I have a module cms.py with functions that take care of setting validators on db and labels on form. In that module I import: from gluon.html import * from gluon.validators import * When I import cms.py in db.py: from applications.init.modules.cms import* I don't get a syntax warning however

[web2py] Re: web2py and timezones

2013-03-18 Thread Niphlod
uhm. The real problem of a client-side implementation is that if the client pc is not set correctly, it obviously fails. Assuming that we're ok with that (i.e. most of the times the client clock is set correctly) this implementation is fine for the current day but doesn't account for DST at

[web2py] Re: web2py and timezones

2013-03-18 Thread Niphlod
Whoops, forgot to tell that jstz is ~5kb if minified, so shipping it shouldn't be a problem at this point, preparing a new field in auth_user or at least a validator with the list of timezones ('europe/rome', 'america/denver, etc etc) to let the client choose it's own (resorting to

Re: [web2py] db column comment

2013-03-18 Thread Alex
Richard, thanks for sharing! Although I don't see how that would help in my case (I'd still have to comment the field in my db.py file) it's good to see some new approaches. Alex Am Donnerstag, 14. März 2013 15:08:39 UTC+1 schrieb Richard: Hello Alex, Here we go... *1) Get all the

Re: [web2py] Not to open a can of worms ... about web2py.com

2013-03-18 Thread Marco Túlio Cícero de M . Porto
I like the page we have now. But Derek made a few points there... maybe we could start from there... 2013/3/15 Massimo Di Pierro massimo.dipie...@gmail.com Somebody suggested web2py.com should look more like http://nodejs.org/ It would not be difficult to do. Should it be done? Massimo --

[web2py] Re: SyntaxWarning: import * only allowed at module level

2013-03-18 Thread Anthony
This is a Python issue and has to do with variable scopes and bytecode compiling -- see http://stackoverflow.com/questions/3571514/python-why-should-from-module-import-be-prohibited. Note, it's only a warning in this case, not an exception (though there are cases where it would raise an

[web2py] Re: automatically populate child field with parent field

2013-03-18 Thread Mark
try form.vars.sharedServiceID=sharedServiceID On Sunday, March 17, 2013 3:13:58 AM UTC-4, Alex Glaros wrote: I'm trying to automatically populate child FK field sharedServiceID using the controller below, but the field gets filled with none Do you see any flaw in the controller format

[web2py] using generateDS web2py application wizard for making web applications from xsd files

2013-03-18 Thread Bill Thayer
Over the weekend I was working on and exploring the possibility of using generateDS.py http://www.rexx.com/~dkuhlman/generateDS.html to create python objects for an xsd file and modifyiing its included django script to instead create the web2py.metadata file that comes with the appadmin

Re: [web2py] Re: Override _autocomplete function

2013-03-18 Thread Richard Vézina
Hello Calvin, This seems interesting. I was planning to work un this when I get time but it looks that what you did is a good start! I have a question, I am not sure how you was thinking to initialize the widget on a select type field?? Should I do something like this in order to use your

[web2py] duckduckgo and web2py

2013-03-18 Thread Michele Comitini
Massimo, Did you know the duckduckgo search engine has a web2py mode ? put !web2py in the search box and have fun! ;-) mic -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it,

[web2py] Re: duckduckgo and web2py

2013-03-18 Thread Niphlod
nice submission ;-) On Monday, March 18, 2013 3:27:36 PM UTC+1, Michele Comitini wrote: Massimo, Did you know the duckduckgo search engine has a web2py mode ? put !web2py in the search box and have fun! ;-) mic -- --- You received this message because you are subscribed to the

[web2py] Re: duckduckgo and web2py

2013-03-18 Thread Anthony
Looks like it specifically searches the book. Here are all the Python related sites for which this works (there are over 1000 other sites as well): *Languages (python):* !crate !dj !django !djangome !djpackages !matplotlib (!mpl) !nullege !numpy !pep !php2py !py3k !pylons !pypi !python (!py)

[web2py] Re: automatically populate child field with parent field

2013-03-18 Thread Alex Glaros
It worked. Thanks Mark. Can you provide a link to any examples where user has the ability to enter a variable number of children? I mean once they type in the parent and one child, something like prompt is displayed asking do you want to add another child record?. This would let them enter

[web2py] Re: duckduckgo and web2py

2013-03-18 Thread Michele Comitini
do you think it is possible to make it search web2pyslices and maybe the googlegroup? mic Il giorno lunedì 18 marzo 2013 15:53:33 UTC+1, Anthony ha scritto: Looks like it specifically searches the book. Here are all the Python related sites for which this works (there are over 1000 other

[web2py] Re: duckduckgo and web2py

2013-03-18 Thread Niphlod
seems unlikely ... every !bang is associated with a query string On Monday, March 18, 2013 4:13:41 PM UTC+1, Michele Comitini wrote: do you think it is possible to make it search web2pyslices and maybe the googlegroup? mic Il giorno lunedì 18 marzo 2013 15:53:33 UTC+1, Anthony ha scritto:

[web2py] Re: duckduckgo and web2py

2013-03-18 Thread Anthony
I just made submissions for !web2pyslices and !web2pygroup. They have to be separate !bang tags because each only sends requests to a single URL (it's just a shortcut for sending a GET request with a query in the URL). Anthony On Monday, March 18, 2013 11:13:41 AM UTC-4, Michele Comitini

[web2py] Re: SyntaxWarning: import * only allowed at module level

2013-03-18 Thread Annet
Hi Anthony, After having a closer look at the warnings, I observe, it only generates the warning within a function. Thanks for your explanation. Kind regards Annet -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this

[web2py] Re: automatically populate child field with parent field

2013-03-18 Thread Mark
Alex, Sorry, I don't have any related examples and don't know how to do it. I guess you may need a jquery dialog and a while loop, which continue to run until the dialog return No. Mark On Monday, March 18, 2013 11:01:27 AM UTC-4, Alex Glaros wrote: It worked. Thanks Mark. Can you

Re: [web2py] Re: automatically populate child field with parent field

2013-03-18 Thread Richard Vézina
Alex, I think you want to add input in the generated form and this is possible with jQuery but it leed to a list of values instead of value in your form.vars.var... This thread contains many informations about that : https://groups.google.com/d/msg/web2py/UK8NZ1VMlNk/lRqxKgS10ScJ But in your

[web2py] auth_event table not updating

2013-03-18 Thread Lamps902
Looking at my application's databases, it seems that the auth_event table was last updated quite some time ago. I'm not sure what changes I made to the code which could have caused the application to stop logging events to auth_event. Is there anything I should check in my database

[web2py] How can I run multiple applications with multiple domains on nginx?

2013-03-18 Thread Tito Garrido
Hi Folks, I am reading the book section: http://web2py.com/books/default/chapter/29/13#Nginx But I couldn't figure out how could I setup nginx to serve multiple domains pointing to a different application on the same web2py instance. Do you have any example? like: mydomain1 -

[web2py] Re: web2py and timezones

2013-03-18 Thread Niphlod
PS: current implementation breaks a few self in front of timezone required ... Anyway, I'll give it a shot generalizing how I envisioned a timezone preference. PS: Pytz is required On Monday, March 18, 2013 10:12:30 AM UTC+1, Niphlod wrote: Whoops, forgot to tell that jstz is ~5kb if

Re: [web2py] Re: 5th Manual typo p.83

2013-03-18 Thread Massimo Di Pierro
The best way is a patch to the online book: https://github.com/mdipierro/web2py-book/tree/master/sources/29-web2py-english An email works too. ;-) On Monday, 18 March 2013 00:40:13 UTC-5, mweissen wrote: I have found some typos too. Massimo,. what is the best way to tell you about these

[web2py] Re: SQLForm + auth.register OR auth.login

2013-03-18 Thread Massimo Di Pierro
I do not understand. :-( On Friday, 15 March 2013 10:17:50 UTC-5, Marian wrote: I've stuck on this for a while. I need one page where I can create a submission with image uploads etc. and a required reference to auth.user. If the user is logged in it is quite simple but you should create a

[web2py] web2py 2.4.5 is OUT

2013-03-18 Thread Massimo Di Pierro
Passes all tests using travis.ci including python 2.5/2.6/2.7 sqlite/mysql/postgres. Thanks to Marc who originally pushed for travis.ci integration one year ago and Niphlod for his help in getting this to work, explaining it to me like a three years old (and I needed the explanation), and for

Re: [web2py] Re: SQLForm + auth.register OR auth.login

2013-03-18 Thread Michele Comitini
you can make the view where you have the upload form with 2 buttons login and register pointing to default/user/login and default/user/register {{=A('LOGIN', _class='btn', _href=URL('default', 'user', args=['login']))}} If you want to have the registration or login form in the same page, it is

[web2py] Re: automatically populate child field with parent field

2013-03-18 Thread Alex Glaros
Thanks Richard, I'll post a simplified version of my question on a new thread. Alex On Sunday, March 17, 2013 12:13:58 AM UTC-7, Alex Glaros wrote: I'm trying to automatically populate child FK field sharedServiceID using the controller below, but the field gets filled with none Do you

[web2py] Re: web2py 2.4.5 is OUT

2013-03-18 Thread Niphlod
Everyone who needs to ensure a strict backward compatibility on some web2py feature, if not included yet in gluon/tests/*, is **urged** to send new tests (or patches to the existent ones) . Tests are standard unittests, you can run them easily by: 1. pip install unit2 2. cding into the

[web2py] How to create a loop to add multiple child records

2013-03-18 Thread Alex Glaros
Does anyone know how to create a loop allowing variable number of child records to be added to a parent? Here’s a sample where only one child is created. The “client” is the parent record and “address” is the child record. http://web2py.com/books/default/chapter/29/07 Can anyone please

[web2py] Problems after upgrading from 1.98 to 2.42

2013-03-18 Thread Kenneth
Hello, I'm getting: type 'exceptions.AttributeError' 'Row' object has no attribute 'copy' Version web2py™ (2, 4, 2, 'stable', datetime.datetime(2013, 3, 4, 3, 26, 21)) Python Python 2.6.5: /usr/bin/python (prefix: /usr) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. Traceback

Re: [web2py] Re: Override _autocomplete function

2013-03-18 Thread Richard Vézina
Here what I come up with : def autocomplete_typeahead_widget(f, v, **kwargs): table_name = f._tablename field_name = f.name field_requires = f.requires field_value = v options = {'_data-provide':'typeahead', '_autocomplete': 'off'} options.update(kwargs) return CAT(

[web2py] share my new typeahead widget

2013-03-18 Thread Richard
Hello, Wrote this and it may be handy for others in the meantime there is a better integration of autocomplete bootstrap typeahead : # Widget function def autocomplete_typeahead_widget(f, v, **kwargs): table_name = f._tablename field_name = f.name field_requires = f.requires

[web2py] Re: Problems after upgrading from 1.98 to 2.42

2013-03-18 Thread Massimo Di Pierro
Please try 2.4.5. Let us know if this is not fixed alreday. On Monday, 18 March 2013 19:42:38 UTC-5, Kenneth wrote: Hello, I'm getting: type 'exceptions.AttributeError' 'Row' object has no attribute 'copy' Version web2py™ (2, 4, 2, 'stable', datetime.datetime(2013, 3, 4, 3, 26, 21))