Re: [web2py] calling custom javascript functions

2014-01-12 Thread Jonas Fredriksson
I just wanted to see if it's possible to call custom made js functions using jQuery. I found that it is possible to call by using this function: $(document).ready(function() { $(function_call()); } css tags can also be added. but it is simpler to just use myfunction(); In the web2py book

[web2py] Re: How to use a bootstrap button group as radio buttons in a custom form

2014-01-12 Thread Alan Etkin
hoping someone can point me in the right direction, as the post title says I want to use a btn-group Try using name=opt for the input element. However, it would be better to use a custom widget. http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#Widgets -- Resources:

[web2py] Re: How to add users to a table row by request

2014-01-12 Thread Alan Etkin
There is a built-in feature for RBAC (Auth). Check the book http://www.web2py.com/books/default/chapter/29/09/access-control#Access-Control -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Get label of field

2014-01-12 Thread Alan Etkin
My doubt is, how i get the labels of specific field, or a group of fields, or all fields? table, field = col.split(.) db[table][field].label field label -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] How not to update data on live version.

2014-01-12 Thread Avi A
Hi, Assuming i got my local version, which I want to upload to the live version. How do I make the updating without overwritng/updating the db on the live version? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: Error with virtual field

2014-01-12 Thread rif
Manuele: Massimo suggested adding the virtualfield name parameter like this: db.testtable.testfield = Field.Virtual('testfield', lambda row: 'foo') It works this way. In my ticket (http://code.google.com/p/web2py/issues/detail?id=1851) I have taken the example directly from the book so I made

[web2py] Re: How not to update data on live version.

2014-01-12 Thread LightDot
This can be very simple or complex, depending on if you made any changes to the database structure or its access information. Assuming you didn't change anything about your database, the solution is to simply don't upload your applications/yourapp/databases folder. You really should read about

[web2py] 'tzinfo' is an invalid keyword argument for this function

2014-01-12 Thread Graham Robbins
IS_DATE() formatter sets d = datetime.date(year, value.month, value.day) and if self.timezone is not None it calls d.replace with the tzinfo keyword, this results in the exception: File /home/www-data/web2py/gluon/validators.py, line 2263, in formatter d =

[web2py] Re: Scheduler: Error retrieving status?

2014-01-12 Thread Niphlod
nope, it doesn't, but auth.user_id defaults to None if there is no logged-in user. Not sure what happened without having the complete app code, however the scheduler tables are not meant to be altered, e.g. with common_fields, so it definitely should have been those to make the scheduler not

[web2py] Re: GAE: insert using key_name

2014-01-12 Thread Quint
ok, understood. This is really the only thing I need: def _pre_process(self, table, **fields): Takes a w2p table and a dictionary with values and processes the field input and add defaults, computes, etc using the web2py table. fields =

[web2py] Re: GAE: insert using key_name

2014-01-12 Thread Alan Etkin
I gues my question is, can users safely rely on _something methods? The change revert is due this concern about api reliability, so adapters behave as specified in http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=_insert#Raw-SQL What is w2p's policy

[web2py] web2py takes about 30secs to launch (on MacBook Pro, OS X 10.9.1)

2014-01-12 Thread Horst Horst
...and guess what what: I've been working on my first web2py project since almost three month, and thought this was normal! (I hear you laughing.) Until yesterday when I had my WLAN turned off and web2py launched almost instantly. I couldn't believe it, launched the debugger, and traced the

[web2py] Re: How to add users to a table row by request

2014-01-12 Thread Anthony
If these groups are for the purpose of controlling access to resources, you might consider using the built-in role-based access control available via Auth. You would create Auth groups and then assign users as members to groups. You could then use auth.has_membership() and

Re: [web2py] calling custom javascript functions

2014-01-12 Thread Anthony
Did you try: $(document).ready(function() { myfunction(); }); Anthony On Sunday, January 12, 2014 3:48:48 AM UTC-5, jonas wrote: I just wanted to see if it's possible to call custom made js functions using jQuery. I found that it is possible to call by using this function:

[web2py] Re: request.uri_language

2014-01-12 Thread Gael Princivalle
Is it possible that nobody knows how this request.uri.language works ? Il giorno venerdì 10 gennaio 2014 13:32:19 UTC+1, Gael Princivalle ha scritto: Hello all. I'm in trouble with language management. Here is my routes.py at web2py root (standard): routers = dict( # base router

Re: [web2py] web2py takes about 30secs to launch (on MacBook Pro, OS X 10.9.1)

2014-01-12 Thread Michele Comitini
try the following on the command line: $ ping $(hostname -f) if it takes long time and then it says something like unkwown host that your machine has a name that is neither resolvable by dns nor by /etc/hosts lookup. To fix the problem try to add the following line in your /etc/hosts: 127.0.0.1

[web2py] Re: request.uri_language

2014-01-12 Thread Alan Etkin
Is it possible that nobody knows how this request.uri.language works ? Shouldn't this app: dict( be this way instead? test: dict( -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] calling custom javascript functions

2014-01-12 Thread Jonas Fredriksson
yes, and it works. thanks On Sun, Jan 12, 2014 at 3:08 PM, Anthony abasta...@gmail.com wrote: Did you try: $(document).ready(function() { myfunction(); }); Anthony On Sunday, January 12, 2014 3:48:48 AM UTC-5, jonas wrote: I just wanted to see if it's possible to call custom made

[web2py] Re: Error with virtual field

2014-01-12 Thread Massimo Di Pierro
The book is wrong. Fields should have a name. On Sunday, 12 January 2014 04:39:28 UTC-6, rif wrote: Manuele: Massimo suggested adding the virtualfield name parameter like this: db.testtable.testfield = Field.Virtual('testfield', lambda row: 'foo') It works this way. In my ticket

[web2py] Re: 'tzinfo' is an invalid keyword argument for this function

2014-01-12 Thread Massimo Di Pierro
This is wrong in the code but for logical reason. IS_DATE should not accept the timezone info. That is because unless you know a time of the time, it is not possible to determine the date (and time of the day) in the other timezone. This is reflected in the fact that datetime.date does not take

[web2py] Re: 'tzinfo' is an invalid keyword argument for this function

2014-01-12 Thread Anthony
I would lean toward #2 (your default seems reasonable). On Sunday, January 12, 2014 10:20:38 AM UTC-5, Massimo Di Pierro wrote: This is wrong in the code but for logical reason. IS_DATE should not accept the timezone info. That is because unless you know a time of the time, it is not

[web2py] Re: request.uri_language

2014-01-12 Thread Gael Princivalle
Thanks Alan you're right. But with this routes.py in web2py root : routers = dict( BASE=dict( default_application='test', ), ) And this routes.py in test folder: from fileutils import abspath from languages import read_possible_languages possible_languages =

Re: [web2py] Re: request.uri_language

2014-01-12 Thread Jonathan Lundell
On 12 Jan 2014, at 7:51 AM, Gael Princivalle gaelprinciva...@gmail.com wrote: And this routes.py in test folder: from fileutils import abspath from languages import read_possible_languages possible_languages = read_possible_languages(abspath('applications', test)) routers = { test: dict(

[web2py] Re: request.uri_language

2014-01-12 Thread Alan Etkin
I've got this server error: 200 Error My bad, unless you have specified the name or it is available in that scope, using app, test or whatever would raise a NameError. Perhaps it can be solved using a string (test) for the dictionary key. routers = { test: dict(

Re: [web2py] Re: request.uri_language

2014-01-12 Thread Jonathan Lundell
On 12 Jan 2014, at 8:27 AM, Alan Etkin spame...@gmail.com wrote: I've got this server error: 200 Error My bad, unless you have specified the name or it is available in that scope, using app, test or whatever would raise a NameError. Perhaps it can be solved using a string (test) for the

Re: [web2py] web2py takes about 30secs to launch (on MacBook Pro, OS X 10.9.1)

2014-01-12 Thread Horst Horst
Thanks, Michele! Even though the ping isn't particularly slow, adding the entry to /etc/hosts does the trick for the web2py startup. I'm still thinking that lookups might be slow for all sorts of reasons, and the following bunch of lines should perhaps be moved from console() into

Re: [web2py] Re: How to add users to a table row by request

2014-01-12 Thread Andrew Evans
Excellent! Thank you Anthony this solved my problem. Also thank you for the clear explanations :-) *cheers On Sun, Jan 12, 2014 at 6:05 AM, Anthony abasta...@gmail.com wrote: If these groups are for the purpose of controlling access to resources, you might consider using the built-in

[web2py] Re: How not to update data on live version.

2014-01-12 Thread Avi A
Thanks. On Sunday, January 12, 2014 1:06:08 PM UTC+2, LightDot wrote: This can be very simple or complex, depending on if you made any changes to the database structure or its access information. Assuming you didn't change anything about your database, the solution is to simply don't

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread zee
Sorry, maybe I wasn't clear, this is the original code : if form.vars.npa_complement: pass else: form.vars.npa_complement = 0 onrp_row = db( (db.npa.npa==form.vars.npa) (db.npa.loc_name_short==form.vars.lns)

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread zee
I believe the function definition : def get_onrp(npa, lns, npc=0): does set the value of npc to 0 if the argument is not passed to the function call. On Saturday, January 11, 2014 10:56:56 AM UTC+1, zee wrote: Hi, First post here, so thanks in advance for any help provided. I have a

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread Anthony
On Sunday, January 12, 2014 2:43:33 PM UTC-5, zee wrote: I believe the function definition : def get_onrp(npa, lns, npc=0): does set the value of npc to 0 if the argument is not passed to the function call. Yes, but your code always passes form.vars.npc as the third argument, so that is

[web2py] can't see errors on components.

2014-01-12 Thread Avi A
Hi, Working on ajax components, I got error/s. It flashes there is an error. but where can I find the code? thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread zee
Ok, I will take that into account. In any case, I have tried calling the function with actual values that are the DB as following : onrp_id = get_onrp(1000, 'Lausanne', 12) just to ensure the function works, but without success. On Saturday, January 11, 2014 10:56:56 AM UTC+1, zee

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread zee
Ok, your comment took a little time to sink in, but I think I got it now. I modified the function to take in account form.vars.npc set to None. I think it works now, Thanks ! On Saturday, January 11, 2014 10:56:56 AM UTC+1, zee wrote: Hi, First post here, so thanks in advance for any help

[web2py] iframe without iframe

2014-01-12 Thread Kenneth
Hello, is there a way of integration data from an web2py site into an other sites. Like many integrates Tvitter Tweedk onto theur website. I't like to use web2py to create a small page that is shown on another website, like iframe but without iframes. Any ideas for this? Kenneth --

[web2py] Suggestions required for Sorting GRID

2014-01-12 Thread Sarbjit
As per suggestions from this post.https://groups.google.com/forum/#!searchin/web2py/passing$20query$20controller/web2py/meeqqMTozrQ/o_kIUeKDkZ4JI have solved the problem to view the grid results in a different controller by storing the grid results in a session and in the second controller, I

[web2py] Re: keepvalues - need help with this

2014-01-12 Thread subbaraman . kiran
Really would like some help with this. Anyone have suggestions? Thank you, Kiran On Saturday, January 11, 2014 12:10:07 AM UTC+5:30, subbaram...@gmail.com wrote: Hello All, The *design *is: I have a custom form with the a controller that inserts/updates a table. Tthe form accepts data, and

[web2py] Re: Getting a 'list' object has no attribute 'xml' error when exporting smartgrid data in HTML format.

2014-01-12 Thread Rahul
Hi Tim, Thanks! I downloaded Git for windows and created a clone of web2py project for myself. I could see that I have web2py project folder created for me and I ran web2py from there. I copied my application to applications folder and tried running it from there. It gave me the same error