[web2py] embeded python code in web2py raise error

2012-08-16 Thread Hojat Taheri
hi, not to waste time, plz tell me how should i use this code in controller default.py : it works in python well but in web2py error..error..error from urllib2 import Request, urlopen, URLError url = request.vars.url req = Request(url) try: response = urlopen(req) except

[web2py] Re: Using Decorators for RESTful URLs

2012-08-16 Thread deepak
I would like to perform REST Services by mapping url to the controller-function. For eg: @app.route('/')def api_root(): return 'Welcome' @app.route('/articles')def api_articles(): return 'List of ' + url_for('api_articles') @app.route('/articles/articleid')def api_article(articleid):

[web2py] How to find duplicate rows with Web2py DAL

2012-08-16 Thread Loreia
Hi, I am looking for a way to automatically find any possible duplicate records (rows) in one table of my Postgres database. Quick google-ing reveals it is easy to do it with pure SQL, e.g. one way specific for Postgres:

[web2py] Re: Table Inheritance (Was Re: KeyError : 'name' when inserting/updating via sqlform.grid)

2012-08-16 Thread Mandar Vaze
Duplicate of http://code.google.com/p/web2py/issues/detail?id=648 The error goes away if unique=True is removed. -Mandar On Thursday, August 9, 2012 9:13:36 PM UTC+5:30, Mandar Vaze wrote: I figured out that problem is due to the way I have defined Table Inheritance for mother/father/child.

[web2py] Re: KeyError: 'name' when inserting/updating via appadmin

2012-08-16 Thread Mandar Vaze
Duplicate of http://code.google.com/p/web2py/issues/detail?id=648 The error goes away if unique=True is removed. -Mandar On Monday, August 13, 2012 1:02:55 PM UTC+5:30, Mandar Vaze wrote: Done. http://code.google.com/p/web2py/issues/detail?id=931 -Mandar On Saturday, August 11, 2012

[web2py] postgres not creating table -- need help with migrate settings

2012-08-16 Thread weheh
I've added a new table to my existing postgres db but it's not getting created. My DAL and table settings are as follows: db = DAL( 'postgres://...my_credentials...', pool_size=20, migrate_enabled=True, fake_migrate=True, ) db.define_table( 'migrate_queue',

[web2py] Re: postgres not creating table -- need help with migrate settings

2012-08-16 Thread weheh
Ah, heck. I decided to rename the table and got it to work. I'm wondering ... I have a function under models where it says def migrate_queue(): I'm wondering if this creates a conflict and causes the system to not create the desired table? --

[web2py] Re: postgres not creating table -- need help with migrate settings

2012-08-16 Thread weheh
Bother again! There is another table that's not getting created, so this is still an issue. --

[web2py] Re: LinkedIn Integration - my step by step tutorial

2012-08-16 Thread Carl
Having used Udi's additions to Web2py to get basic authentication using LinkedIn working I'd like to interact with the LinkedIn API. I can get to this functonality using linkedin.py (by Ozgur Vatansever) in a controller using auth.settings.login_form.session.linkedin e.g.,

Re: [web2py] Graphs

2012-08-16 Thread Andrew
I plan to do one, but you simply provide a json or csv service / URL with web2py, and then use it in a view with the d3 JavaScript code. D3 takes some learning, and I still have a long way to go. --

[web2py] I'm looking sourc Web2Py Electronic Health Record

2012-08-16 Thread Ulugbek Nurjonov
HI all who can give source Web2Py Electronic Health Record --

Re: [web2py] Re: LinkedIn Integration - my step by step tutorial

2012-08-16 Thread Alec Taylor
I for one couldn't get the session variable to work properly, and received an error (see: https://groups.google.com/forum/#!topic/web2py/D7hwgsbBemk) On Thu, Aug 16, 2012 at 8:38 PM, Carl m...@carlroach.com wrote: Having used Udi's additions to Web2py to get basic authentication using LinkedIn

Re: [web2py] Re: LinkedIn Integration - my step by step tutorial

2012-08-16 Thread Carl Roach
I haven't integrated this LinkedIn with GAE just yet. I'll see if I get the same exception when I do. On 16 Aug 2012, at 11:45, Alec Taylor alec.tayl...@gmail.com wrote: I for one couldn't get the session variable to work properly, and received an error (see:

Re: [web2py] Re: LinkedIn Integration - my step by step tutorial

2012-08-16 Thread Carl Roach
Then you got a real note resting exception: type 'exceptions.ImportError' No module named google.appengine.api I didn't get this. I'm using latest Web2py. On 16 Aug 2012, at 11:51, Alec Taylor alec.tayl...@gmail.com wrote: I'm not using GAE, I've tried to get it working on the Rocket server

Re: [web2py] I'm looking sourc Web2Py Electronic Health Record

2012-08-16 Thread Alfonso de la Guarda
Hello, I know this list is by web2py and I am a regular user of the framework to generate valuable content, however, when it comes to EMR, we refer to an entire complex system that must be related to imaging, laboratory and administrative systems even that HL7 or Mirth without mentioning ... That

Re: [web2py] Re: LinkedIn Integration - my step by step tutorial

2012-08-16 Thread Alec Taylor
I'm running almost the latest trunk, # 4e02406b61c9de725a0b73ae9b73b71f4b1c2413 (from 16 hours ago) And have been getting this error. Maybe I've misordered things... here is my db.py: http://pastebin.com/1gE50Rnn (my controller is the same as in the web2pyslice page) On Thu, Aug 16, 2012 at

[web2py] Re: postgres not creating table -- need help with migrate settings

2012-08-16 Thread weheh
The log shows that the table that's not getting created was created but with the comment faked! after it. Postgres inspection shows table not created. On Thursday, August 16, 2012 7:07:15 PM UTC+8, Niphlod wrote: just open sql.log in the databases folder and see what is going on On

[web2py] Re: postgres not creating table -- need help with migrate settings

2012-08-16 Thread Niphlod
and this is fine because you have fake_migrate=True, so, what do you want ? On Thursday, August 16, 2012 1:55:31 PM UTC+2, weheh wrote: The log shows that the table that's not getting created was created but with the comment faked! after it. Postgres inspection shows table not created.

[web2py] Is using composite key with SQLFORM.grid allowed ?

2012-08-16 Thread Mandar Vaze
I've an associate table for many-to-many relationship with composite key defined as follows : db.define_table('user_skill', Field('user', db.user), Field('skill', db.skill), primarykey=['user', 'skill']) When I use SQLFORM.grid for the above table, I get the following error :

[web2py] index in list of fields

2012-08-16 Thread simon
Please can someone explain why, for a list of fields, that fields.index(anything at all) always evaluates to 0. For example this prints 23 and 0. t=db.todo fields = [t.id, t.customer, t.subject, t.completed, t.modified_by] if 23 in fields: print(23 is in there) print(fields.index(hshshshs))

[web2py] SQLFORM.smartgrid field labels not I18N

2012-08-16 Thread Felipe Meirelles
Yarrr! So, I'm using the smartgrid beta and noticed that some parts of it are not I18N. Should I fix it and send a patch or you guys are working on it already? Thanks --

[web2py] SQLFORM.smartgrid field labels not I18N

2012-08-16 Thread Massimo Di Pierro
That would be great. Or simply list the parts not internationalized --

Re: [web2py] SQLFORM.smartgrid field labels not I18N

2012-08-16 Thread Felipe Meirelles
Nah, I'll do it, the community is so supportive and its make me on the mood to contribute (: I'll just will need some help to send you a patch, never did it on github On Thu, Aug 16, 2012 at 10:53 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: That would be great. Or simply list the

[web2py] Re: Electronic voting anybody?

2012-08-16 Thread Rob_McC
Massimo: Thanks... I did more testing this morning, 1- set up 3 voters, one with email ending in .on.ca, and I didn't get that one, maybe it is our server, I checked JUNK email, nothing 2- the other 2 emails worked, got email, got voting confirmation, BUT.. confirmation shows I definetly

[web2py] Re: Is using composite key with SQLFORM.grid allowed ?

2012-08-16 Thread Mandar Vaze
OK, the following may be my own mistake (I changed a normal table to the one with composite key without changing rest of the code) Now, next question : via appadmin, how can I edit a record from a table with contains the composite key ? Normally, user would click on id shown in the table which

Re: [web2py] Re: client-side validation plugin

2012-08-16 Thread Franco
Try with this version. I need to warning you the python regex are different of javascript regex, so it could be problematic depending of the regex that you use. El miércoles, 15 de agosto de 2012 00:37:35 UTC-3, Alec Taylor escribió: Thanks a heap Franco :) The only suggestion I have is to

Re: [web2py] Re: client-side validation plugin

2012-08-16 Thread Alec Taylor
Thanks :) On Fri, Aug 17, 2012 at 1:15 AM, Franco franco.alar...@gmail.com wrote: Try with this version. I need to warning you the python regex are different of javascript regex, so it could be problematic depending of the regex that you use. El miércoles, 15 de agosto de 2012 00:37:35

[web2py] ExtendedLoginForm incompatible with class LinkedInAccount?

2012-08-16 Thread Carl
Is ExtendedLoginForm intended to be used by OAuth implementations such as LinkedInAccount? Or only for authentications that use a HTML form to prompt the user for credentials? --

[web2py] Small Book Update Needed chapter/29/7#SQLFORM

2012-08-16 Thread JoeCodeswell
Dear web2py Book Team, In chapter/29/7#SQLFORM where it is explaining the arguments of the SQLFORM function, the *buttons *argument doesn't have its name in front of its explanation. Love and peace --

[web2py] Re: postgres not creating table -- need help with migrate settings

2012-08-16 Thread weheh
Nothing changes if fake_migrate=False and db.define_table('mytable', ... migrate=True). What I want is 'mytable' to be built, which it isn't. On Thursday, August 16, 2012 7:58:44 PM UTC+8, Niphlod wrote: and this is fine because you have fake_migrate=True, so, what do you want ? On Thursday,

[web2py] Re: index in list of fields

2012-08-16 Thread Massimo Di Pierro
Cannot reproduce: a=[1,2,3] a.index(0) Traceback (most recent call last): File stdin, line 1, in module ValueError: 0 is not in list On Thursday, 16 August 2012 08:31:51 UTC-5, simon wrote: Please can someone explain why, for a list of fields, that fields.index(anything at all) always

[web2py] Re: index in list of fields

2012-08-16 Thread Massimo Di Pierro
On a second thought probably the index method compares with == and not is. as in def index(list,value): for k,vin enumerate(list): if v==value: return k raise ValueError, %s is not in list % value while it should do def index(list,value): for k,vin

Re: [web2py] SQLFORM.smartgrid field labels not I18N

2012-08-16 Thread Massimo Di Pierro
You can use github but mind github does not send notification and sometime they wait there for longer then they should. I always apply patches manually because I have to manage both git and hg. If you email me the patch (or a diff) or post it in a google code issue it is even better for me.

[web2py] Re: Electronic voting anybody?

2012-08-16 Thread Massimo Di Pierro
Strange problem. I have not seen it before. I will double check it. The editor is cleditor. I never used it before but looked simple enough. In particular the plugins are very easy to make compared to other editors. I also like that it supports tables. Massimo On Thursday, 16 August 2012

[web2py] Re: Is using composite key with SQLFORM.grid allowed ?

2012-08-16 Thread Massimo Di Pierro
No SQLFORM.grid does not support keyed tables. Sorry. On Thursday, 16 August 2012 07:23:15 UTC-5, Mandar Vaze wrote: I've an associate table for many-to-many relationship with composite key defined as follows : db.define_table('user_skill', Field('user', db.user),

[web2py] Re: index in list of fields

2012-08-16 Thread Anthony
Field objects inherit from the DAL Expression class, which overloads the == operator, which produces a Query object rather than actually testing for equality. So, when comparing the argument passed to index() against Field objects in the list, you will never get a False. If the first item in

[web2py] Re: postgres not creating table -- need help with migrate settings

2012-08-16 Thread Massimo Di Pierro
If you set fake_migrate=True you mean my table are there, do not create them, but make the .table files. The .table files tell web2py that the tables are in the database. If you then fake_migrate=False and migrate=True, web2py checks the .table and decides the tables are there (because you

[web2py] Re: Small Book Update Needed chapter/29/7#SQLFORM

2012-08-16 Thread Anthony
That's odd -- it's in the markmin. Massimo, any idea what the problem is? On Thursday, August 16, 2012 11:54:45 AM UTC-4, JoeCodeswell wrote: Dear web2py Book Team, In chapter/29/7#SQLFORM where it is explaining the arguments of the SQLFORM function, the *buttons *argument doesn't have its

[web2py] Re: I'm looking sourc Web2Py Electronic Health Record

2012-08-16 Thread Anthony
Are you talking about this: http://code.google.com/p/web2pyhl7/ Anthony On Thursday, August 16, 2012 4:14:12 AM UTC-4, Ulugbek Nurjonov wrote: HI all who can give source Web2Py Electronic Health Record --

[web2py] Re: postgres not creating table -- need help with migrate settings

2012-08-16 Thread weheh
Thanks, Massimo. I screwed up -- earlier on I had deleted the *.table file for mytable but I must have not set fake_migrate to False. I just did it again, making sure the fake_migrate=False, and it works. Life is good. --

[web2py] Image doesn't appear?

2012-08-16 Thread lyn2py
Hi guys, I'm using Version 2.00.0 (2012-08-07 22:45:43) dev model db.define_table('staff', Field('user_id','reference auth_user',default=auth.user_id,writable= False,readable=False), Field('photo', 'upload', uploadfield='image_file'), Field('image_file', 'blob') ) controller def

[web2py] Re: Electronic voting anybody?

2012-08-16 Thread Massimo Di Pierro
Did the two voted at times very close to each other... Did you vote first for 1 or first for 3? On Thursday, 16 August 2012 09:15:10 UTC-5, Rob_McC wrote: Massimo: Thanks... I did more testing this morning, 1- set up 3 voters, one with email ending in .on.ca, and I didn't get that

[web2py] Re: Image doesn't appear?

2012-08-16 Thread Massimo Di Pierro
form = SQLFORM(db.staff,record) should be form = SQLFORM(db.staff,record,upload=URL('download')) On Thursday, 16 August 2012 11:43:14 UTC-5, lyn2py wrote: Hi guys, I'm using Version 2.00.0 (2012-08-07 22:45:43) dev model db.define_table('staff', Field('user_id','reference

[web2py] Re: Using Decorators for RESTful URLs

2012-08-16 Thread Anthony
web2py does not use decorators to specify routes like Flask does (which can get cumbersome and difficult to maintain with lots of routes). Instead, first, you get default routing without making any explicit routing specifications -- see the link I posted earlier:

Re: [web2py] Re: Functions in Views

2012-08-16 Thread Massimo Di Pierro
you are right. I think this is now fixed on google code (not on github because I am behind a firewall and cannot push to github right now). Massimo On Thursday, 16 August 2012 00:42:34 UTC-5, Anthony wrote: Massimo, note that prettydate() does fail silently due to a try/except (the except

[web2py] Can web2py serve REST data of many-to-may tables via parse_as_rest?

2012-08-16 Thread Matthew Wood
I'm posting this question here as well as on stackoverflowhttp://stackoverflow.com/questions/11991678/can-web2py-serve-rest-data-of-many-to-may-tables-via-parse-as-rest. So hopefully the extra exposure will help me out! I need to serve REST data about a many-to-many relationship. I've been

[web2py] Re: Using Decorators for RESTful URLs

2012-08-16 Thread Massimo Di Pierro
I would recommend Anthony's solution but you can do something similar like this: 1) create a file routes.py with # begin routes_in = [ ('/' , '/appname/default/api_root'), ('/articles' , '/appname/default/api_articles'), ('/article/(?Pid\d+)' ,

[web2py] Re: Question about Human-readable forms + REST CRUD APIs.

2012-08-16 Thread Matthew Wood
If you have any advice. :-) I most certainly don't! I wish I had enough experience to really get in on this conversation. Your ajax solution seems pretty doable, but you're absolutely correct that it would require javascript at all times. For what it's worth, the suggestions from the flask

[web2py] Re: Image doesn't appear?

2012-08-16 Thread lyn2py
Thanks Massimo! Although the [file|delete] overlaps with the browse button. On Friday, August 17, 2012 1:05:48 AM UTC+8, Massimo Di Pierro wrote: form = SQLFORM(db.staff,record) should be form = SQLFORM(db.staff,record,upload=URL('download')) On Thursday, 16 August 2012 11:43:14 UTC-5,

[web2py] Re: Question about Human-readable forms + REST CRUD APIs.

2012-08-16 Thread Matthew Wood
I'v been fiddling with these ideas. They are very similar to the flask/sqlalchemy solutions I've seen in my other queries. Thanks a ton for the suggestions. This is a pretty nice community. On Sunday, July 29, 2012 11:16:53 PM UTC-6, Anthony wrote: - if you define your models carefully

Re: [web2py] Re: Functions in Views

2012-08-16 Thread Anthony
Does this break backward compatibility, or do you consider this a bug? Note, Pystar's problem is not that the function was failing silently, but that his item.now value was a string when he expected it to be a datetime object (i.e., now it will still fail, but not silently). Anthony On

[web2py] map_hyphens and pattern-based routes

2012-08-16 Thread Neil
Hopefully this is an easy one. I'm using a pattern-based routes.py file. How can I enable map_hyphens functionality? Do I have to come up with a regex for my routes_in and routes_out, or is there a way to mix pattern-based and parameter-based systems? Thanks, Neil --

[web2py] Re: in trunck - cannot access web2py site with IE when it's running under apache

2012-08-16 Thread Omi Chiba
Massimo, Sorry, for the late reply. I downloaded the latest Version 2.0.0 (2012-08-15 17:30:38) dev and confirmed it fixed now. On Tuesday, August 7, 2012 5:01:56 PM UTC-5, Massimo Di Pierro wrote: It is probably because of this line in gluon/main.py if not

[web2py] Re: calling custom_store and custom_retrieve using parameters

2012-08-16 Thread Jim Gregory
Thanks, that is helpful. But the path does not seem to be passed in the custom retrieve. Field('file','upload', uploadir='/path/to/folder', custom_store=lambda file,filename,path:store_file(file,filename,path), custom_retrieve=retrieve_file On Wednesday, August 8, 2012 6:51:44 AM UTC-5,

Re: [web2py] Complex query in DAL?

2012-08-16 Thread pbreit
I'd rather stay in app code. If I do db.executesql(..., as_dict=True) could I copy that into a Storage object to get something roughly similar to a DAL object? I started trying to build it in DAL and got part of the way. I was seeing a problem with the counts where it wasn't executing multiple

Re: [web2py] Re: Functions in Views

2012-08-16 Thread Pystar
To Max, Like Anthony said, why is a datetime object I retrieved from my database in a controller automatically converted to a string object? and how come prettydate() cant convert datetime objects that are strings too? Is this a feature of a bug? I also discovered that if i do this in my view

[web2py] IS_IN_DB doesn't show dropdown for the table with primarykey ?

2012-08-16 Thread Omi Chiba
It shows the dropdown list when I define IS_IN_DB like this. (See OK) But doesn't appear when I use the table with primary key (See NG) OK -- db.define_table('person', Field('modified_on', 'datetime',

Re: [web2py] Re: Functions in Views

2012-08-16 Thread Pystar
I would also like to know the format that the request.now value which is equivalent to datetime.datetime.now() follow? i,e, If I was to convert a string to a datetime object using the datetime.datetime.strptime(datetimestring, [format]), I tried passing %Y-%m-%d %h:%m:%f but I got a traceback

Re: [web2py] Re: Functions in Views

2012-08-16 Thread Anthony
Can we see your model? Are you sure the timestamp field is a datetime field and not a string field? When I try prettydate with a datetime field, it works fine? Anthony On Thursday, August 16, 2012 3:26:24 PM UTC-4, Pystar wrote: To Max, Like Anthony said, why is a datetime object I

[web2py] Re: IS_IN_DB doesn't show dropdown for the table with primarykey ?

2012-08-16 Thread Anthony
IS_IN_DB does not produce a dropdown when it is in a list, only when it stands alone. If you want the dropdown and want to use additional validators, use it's _and argument -- see http://web2py.com/books/default/chapter/29/7#Database-validators. Anthony On Thursday, August 16, 2012 3:27:30 PM

Re: [web2py] Complex query in DAL?

2012-08-16 Thread Anthony
On Thursday, August 16, 2012 3:07:12 PM UTC-4, pbreit wrote: I'd rather stay in app code. If I do db.executesql(..., as_dict=True) could I copy that into a Storage object to get something roughly similar to a DAL object? You might try something like this:

Re: [web2py] Re: Functions in Views

2012-08-16 Thread Pystar
I goofed, A big apology to Anthony and Max. It works now, I actually didnt define a FIELDTYPE in my db definition so I guess it just defaulted to storing the field values as a string. On Thursday, August 16, 2012 8:37:56 PM UTC+1, Anthony wrote: Can we see your model? Are you sure the

[web2py] Re: IS_IN_DB doesn't show dropdown for the table with primarykey ?

2012-08-16 Thread Omi Chiba
So I have to define it in Controller like below ? I just want to use dopdown list from another table just like person, dog tables but why it's acting differently when I use primarykey ? def index(): (...) query = (db.table.field == 'xyz') #in practice 'xyz' would be a variable

[web2py] Re: IS_IN_DB doesn't show dropdown for the table with primarykey ?

2012-08-16 Thread Omi Chiba
Anthony, Nevermind, I finally understand what you mean by IS_IN_DB does not produce a dropdown when it is in a list I changed like the following and it works !! db.EDXHLF00.HLHSHH.requires=IS_IN_DB(db,db.TDMHLL00.HLHSHH) On Thursday, August 16, 2012 2:42:03 PM UTC-5, Anthony wrote: IS_IN_DB

[web2py] Web2py GAE strange error type 'exceptions.IOError' [Errno 13] file not accessible: (jQuery.js)

2012-08-16 Thread Akash Kakkar
Hi, I have tried deploying an earlier version of my app on gae and was successful, unfortunately the product release version of my app is faltering when I try to run locally on gae before deploying and was getting undefined error. In the process of debugging I made changes in my app.yaml file

[web2py] Re: Electronic voting anybody?

2012-08-16 Thread Rob_McC
Be glad to test some more, here are details from my previous test: *Here are the TWO confirmation email I received. * Times are noted, they were quite close NOTE: Will you have a TIME ZONE setting for the application? Then, I would know, what time voted on based on my time zone... Candidate

Re: [web2py] Re: Can't import external modules

2012-08-16 Thread Matt
On Thursday, August 16, 2012 12:24:34 AM UTC-4, Matt wrote: On Wed, Aug 15, 2012 at 10:03 PM, Anthony abasta...@gmail.com wrote: Is there any way around this? This seems to have broken only with the upgrade to Mountain Lion. We develop this app primarily on (and for) linux, however

Re: [web2py] map_hyphens and pattern-based routes

2012-08-16 Thread Jonathan Lundell
On 16 Aug 2012, at 10:33 AM, Neil yager.n...@gmail.com wrote: I'm using a pattern-based routes.py file. How can I enable map_hyphens functionality? Do I have to come up with a regex for my routes_in and routes_out, yes or is there a way to mix pattern-based and parameter-based systems? no

Re: [web2py] Re: Can't import external modules

2012-08-16 Thread Anthony
You should not need to use local_import, which is deprecated. Regular import should work, so there is a problem somewhere. Anthony On Thursday, August 16, 2012 4:52:54 PM UTC-4, Matt wrote: On Thursday, August 16, 2012 12:24:34 AM UTC-4, Matt wrote: On Wed, Aug 15, 2012 at 10:03 PM,

Re: [web2py] Re: Can't import external modules

2012-08-16 Thread Anthony
Do you still have all the __init__.py files (i.e., in /web2py, /applications, /yourapp, and /yourapp/modules)? On Thursday, August 16, 2012 5:29:30 PM UTC-4, Anthony wrote: You should not need to use local_import, which is deprecated. Regular import should work, so there is a problem

[web2py] is_impersonating again...

2012-08-16 Thread Martin Weissenboeck
I have am menu with someting like ('stop_impersonating', ... is_impersonating()),... This menu entry should only be activ when impersonating is activ. Now I have tried a fresh installation of web2py and I got: Traceback (most recent call last): File /etc/web2py/gluon/restricted.py, line

[web2py] class nav-collapse in layout.html

2012-08-16 Thread Martin Weissenboeck
I have a program with a menu and I tried Firefox and Google Chrome: Chrom shows the menu, Firefox not. Line 76 in layout.html is: div class=nav-collapse I could not find a definition for the class nav-collapse. Next step: I removed this class definition div !-- was:

[web2py] Re: I'm looking sourc Web2Py Electronic Health Record

2012-08-16 Thread Derek
Just what I was thinking about also. However it looks like the working demo is now invalid. On Thursday, August 16, 2012 9:34:44 AM UTC-7, Anthony wrote: Are you talking about this: http://code.google.com/p/web2pyhl7/ Anthony On Thursday, August 16, 2012 4:14:12 AM UTC-4, Ulugbek Nurjonov

[web2py] Re: Electronic voting anybody?

2012-08-16 Thread Massimo Di Pierro
You found a bug. It is now fixed. Can you please give it one more try? massimo On Thursday, 16 August 2012 15:49:20 UTC-5, Rob_McC wrote: Be glad to test some more, here are details from my previous test: *Here are the TWO confirmation email I received. * Times are noted, they were

Re: [web2py] Re: Can't import external modules

2012-08-16 Thread Massimo Di Pierro
Can you help us test this. If anything caused it, could be changeset: 3324:ef7523559742 --- a/gluon/custom_import.py Wed Jun 06 11:37:28 2012 -0500 +++ b/gluon/custom_import.py Thu Aug 16 18:18:23 2012 -0500 @@ -287,14 +287,14 @@ return super(_Web2pyImporter, self) \

[web2py] Re: Electronic voting anybody?

2012-08-16 Thread Rob_McC
Massimo: *Can you please give it one more try?* . But of course. *But first, I wanted to say thanks for creating web2py, and supporting it, it really is excellent just excellent... * *- - - - - - - - - - - - - - - - - - - - - - - *Here is my Beta test report: Name of Election:

[web2py] Re: Enforcing - like gmail: first character of your username should be a letter (a-z) or number.

2012-08-16 Thread Rob_McC
Anthony: . Thanks for submitting a patch. *Quick Question: With all of the below validations *1- Do they ALL execute or 2- Execution stops at the first one that fails, What I mean is say a user uses a username=bill the first validator will display the message, but does web2py continue to

[web2py] Re: Enforcing - like gmail: first character of your username should be a letter (a-z) or number.

2012-08-16 Thread Anthony
*With all of the below validations *1- Do they ALL execute or 2- Execution stops at the first one that fails, What I mean is say a user uses a username=bill the first validator will display the message, but does web2py continue to evaluate the others? *If so.. * Wouldn't it

[web2py] Re: Electronic voting anybody?

2012-08-16 Thread Massimo Di Pierro
1) is actually a feature. All ballots are always public. Anonymous of course. Perhaps they should only be public after the election is closed? Massimo On Thursday, 16 August 2012 19:35:36 UTC-5, Rob_McC wrote: Massimo: *Can you please give it one more try?* . But of course. *But first,

[web2py] incorporate carsales from web into web2py on my computer

2012-08-16 Thread jayvandal
I down;oaded a file of web2py examples and I wanted to put carsales in my web2py applications sso I could see how the application looks. I downloaded the file that contained car sales and unzipped it .I thought I could unzip it into my folder projects where I could have my applications.I

[web2py] Re: Electronic voting anybody?

2012-08-16 Thread Massimo Di Pierro
I think all the three issues have been addressed. About 1). Now only the voter, the managers (who get copy of the receipt) can see the receipt before the election is closed. After they become public. The managers can get see the receipt. The officer who creates the election can see the results

[web2py] Re: incorporate carsales from web into web2py on my computer

2012-08-16 Thread Massimo Di Pierro
You should use admin to install applications. If you want to do it manually you need do cd applications mkdir appname cd appname tar zxvf /path/to/web2py.app.carsales.w2p at voila'? The w2p files do not contain the parent folder because, to avoid conflict, they want you to name the app. On

[web2py] Re: incorporate carsales from web into web2py on my computer

2012-08-16 Thread Massimo Di Pierro
BTW... it is a very simple example written by a student. On Thursday, 16 August 2012 21:11:01 UTC-5, Massimo Di Pierro wrote: You should use admin to install applications. If you want to do it manually you need do cd applications mkdir appname cd appname tar zxvf

[web2py] Book bug: auth callback example

2012-08-16 Thread JoeCodeswell
auth.settings.register_onaccept.append(lambda form:\ mail.send(to='y...@example.com',subject='new user', message='new user email is %s'%form.vars.email)) Above causes a ticket saying: auth.settings.verify_email_onaccept(lambda form:\ TypeError: 'list' object is not callable

[web2py] Where should I put functions that are useful/common to muliple applications?

2012-08-16 Thread curiouslearn
Hello, What is the recommended place in web2py folder where I should store custom functions that are useful to multiple applications? For example, suppose I have a function such as the following: *def connecttodb():* *if request.is_local:* *user=user* *passwd=passed* *

[web2py] Help me to write SQL query in web2py

2012-08-16 Thread Amit
I have written one sql query: select device_id, sensor_id, max(created_on) from test.abc_tbl where date_sub(now(), interval interval_time minute) created_on group by device_id, sensor_id; How to write it in web2py? Please help me to do the same. Thanks. --

[web2py] Re: Where should I put functions that are useful/common to muliple applications?

2012-08-16 Thread pbreit
I guess site-packages: http://web2py.com/books/default/chapter/29/4?search=site-packages But why oh why aren't you using DAL? --

[web2py] Re: Using Decorators for RESTful URLs

2012-08-16 Thread deepak
Anthony and Massimo, I'd really thank you ppl for giving me a solution with some code! Thats wonderful!. It really helped me get going. Thanks again guys. :) Deepak On Thursday, 16 August 2012 22:37:41 UTC+5:30, Anthony wrote: web2py does not use decorators to specify routes like Flask

[web2py] Re: Where should I put functions that are useful/common to muliple applications?

2012-08-16 Thread curiouslearn
Hello pbreit, Thanks, I will look into that. After posting I realized, I have the same question for css style files and js files. Where can I store those? Can I just store them in one application, and call them using URL() function? Is that the best way, or is there something better? I am new

[web2py] Re: Using Decorators for RESTful URLs

2012-08-16 Thread deepak
I just want to know how to create URL pattern in routes.py, what i really want to understand is, how to parse parameters in URL patterns like the one, Massimo showed in his example -- *('/article/(?Pid\d+)' , '/appname/default/article/$id')* *(?Pid\d+) * * * I would be really helpful if I

[web2py] Re: Using Decorators for RESTful URLs

2012-08-16 Thread Anthony
Using the pattern-based system, you have two options (which can be mixed) -- Python regular expressions as well as an alternative simpler syntax, both described here: http://web2py.com/books/default/chapter/29/4#Pattern-based-system. There are many additional resources on the internet for

[web2py] Re: Can web2py serve REST data of many-to-may tables via parse_as_rest?

2012-08-16 Thread howesc
i personally have not used parse_as_rest so i might be out in left field here.but are you able to access the output of the query and update it before it is returned? or perhaps even better, add a format parameter to the table definitions so that you can format the display of references (to

[web2py] Re: embeded python code in web2py raise error

2012-08-16 Thread howesc
we can't tell what the problem is from the pasted code (aside from indentation that was probably messed up in copy/paste). can you show us an example of your default.py file and the traceback you are getting with the error? On Thursday, August 16, 2012 12:29:25 AM UTC-7, Hojat Taheri wrote:

[web2py] Re: embeded python code in web2py raise error

2012-08-16 Thread Anthony
Is that code inside a function, or just at the top level in the controller? You probably want it in a function. How does request.vars.url get set? Note, if there is no url GET or POST variable, request.vars.url will be None, and Request(url) will raise an exception. Anthony On Thursday,

[web2py] Re: incorporate carsales from web into web2py on my computer

2012-08-16 Thread jayvandal
I put my applications in c:/python27/projects i make my application = cars I change my directory to cars I run some program tar zxvf/\/c:/web2py/applications/web2py.app.carsale.w2p i am running Vista what should tar zxvf be in Vista? I think web2py is good for learning web in python! I