[web2py] rss feed

2012-03-21 Thread Prakhar Srivastava
brother i want to add rss feed in my web2py application Those are the gvot. rss feed i just want call in our application page

[web2py] Bug(?) using list:string in 1.99.7

2012-03-21 Thread Keith Edmunds
My application has broken moving from 1.99.4 to 1.99.7. I have a field of type list:string (using Sqlite). In 1.99.7, dal.py breaks at line 1405 (marked with ): return str(obj) if fieldtype.startswith('list:'): if not obj: obj = [] elif

[web2py] Re: RESTful API: hook before controller is called ?

2012-03-21 Thread howesc
use a decorator on your GET/POST/PUT requests. at least that's what my coworker did and it seems to be working well. On Monday, March 19, 2012 4:16:27 AM UTC-7, sebsto wrote: Hello, Still developing around the RESTfull API. I am looking for a way to handle the HTTP POST payload *before*

[web2py] Re: unit testing web2py and app engine

2012-03-21 Thread howesc
attached is a controller that i use, adapted from the testing tools in the admin interface. note that i set a request parameter 'test_db' and in models i detect that parameter and connect to a different namespace so that my tests run in a controlled DB environment - remember that if you want

Re: [web2py] Re: Spatial / GIS support in DAL

2012-03-21 Thread Manuele Pesenti
Il 21/03/2012 01:24, DenesL ha scritto: Hi Manuele, you are right about PPyGIs, from their caveats: Only EWKB representations are supported — the WKB, EWKT and WKT alternatives are not. At the moment, the DAL can only insert WKT data, as required by the sponsor. But in the future we should

[web2py] Use DAL on local MySQL database

2012-03-21 Thread Jarod G.R. Meng
Hi, I tried to use DAL as standalone module on local MySQL database while developing a GAE app. However, the connection always returned an error Unable to find Adapter. It seems to be problem with importing pymysql as driver. I tried to copy the pymysql folder in gluon/contrib to my app

Re: [web2py] Use DAL on local MySQL database

2012-03-21 Thread Manuele Pesenti
Il 21/03/2012 11:32, Jarod G.R. Meng ha scritto: Hi, I tried to use DAL as standalone module on local MySQL database while developing a GAE app. However, the connection always returned an error Unable to find Adapter. It seems to be problem with importing pymysql as driver. I tried to copy

[web2py] Using Tutorial: type 'exceptions.NameError'(name 'auth' is not defined)

2012-03-21 Thread SeamusJP
I am receiving this error when I am trying to do the image app tutorial. I have followed it explicitly. I replaced all the items in the db.py, as it told me to do here We assume the code below will replace any existing code in db.py. Any ideas?

[web2py] Re: plugins

2012-03-21 Thread A K S V Vijay
Hi Massimo, I'm new to web2py framework. I have started learning the framework recently. We are doing a cloud based project that has to be deployed on Google App Engine. Could you suggest some important things that I need to take care when developing in web2py aiming to

Re: [web2py] Re: DAL validation issue

2012-03-21 Thread Larry G. Wapnitsky
Thanks, Niphlod. Still learning, and asking questions is how I do it. I'll work on your suggestions from this and the other thread. On 3/20/2012 5:10 PM, Niphlod wrote: You are using validators in the wrong way, and also the forms in a twisted one.maybe a little refresh reading the book

Re: [web2py] Re: Two forms, one page

2012-03-21 Thread Larry G. Wapnitsky
Thanks, Niphlod pbreit. Still learning, and asking questions is how I do it. I'll work on your suggestions f FYI, Niphlod - this is the same app as in the other thread. On 3/20/2012 5:38 PM, Niphlod wrote: why not using SQLFORM.factory for having one form for all the data ? in the

[web2py] Re: Bug(?) using list:string in 1.99.7

2012-03-21 Thread Massimo Di Pierro
Thanks for reporting. should now be fixed in trunk. On Wednesday, 21 March 2012 02:22:17 UTC-5, backseat wrote: My application has broken moving from 1.99.4 to 1.99.7. I have a field of type list:string (using Sqlite). In 1.99.7, dal.py breaks at line 1405 (marked with ):

[web2py] Re: plugins

2012-03-21 Thread Anthony
There's a Deploying on Google App Engine section at the end of this chapter in the book: http://web2py.com/books/default/chapter/29/13 On Wednesday, March 21, 2012 5:51:57 AM UTC-4, A K S V Vijay wrote: Hi Massimo, I'm new to web2py framework. I have started learning

[web2py] Re: SQLFORM deletable=True -- buggy behavior

2012-03-21 Thread Anthony
The problems are: - when user checks the delete button in the form, the Are you sure ... message pops up multiple (8) times in succession, requiring a confirmation Are you using an old version of web2py_ajax.html/web2py_ajax.js? Do you have multiple Ajax components on the page?

[web2py] Re: Using Tutorial: type 'exceptions.NameError'(name 'auth' is not defined)

2012-03-21 Thread Anthony
Later, the tutorial also says: Go back to the *edit* page and edit the default.py controller, replacing its contents with the following: It looks like you left the following in the default.py controller: @auth.requires_signature() def data(): etc... Remove that and it should be fine.

Re: [web2py] Re: web2py and roundcube

2012-03-21 Thread George Jekner
Hello, I installed web2py using the deployment script. So whatever is the default. Where can I find the vhost file you are talking about? Thanks, George On Mon, Mar 19, 2012 at 1:29 PM, LightDot light...@gmail.com wrote: This is a problem with your web server configuration. Could you please

[web2py] 2 models / How can you call a model from different application?

2012-03-21 Thread n1ck
I have two different application then I want to call the db/model from another application, how can I do that?

Re: [web2py] Re: plugins

2012-03-21 Thread A K S V Vijay
Thank you Anthony for your reply On Wed, Mar 21, 2012 at 6:10 PM, Anthony abasta...@gmail.com wrote: There's a Deploying on Google App Engine section at the end of this chapter in the book: http://web2py.com/books/default/chapter/29/13 On Wednesday, March 21, 2012 5:51:57 AM UTC-4, A K S V

[web2py] Re: Two forms, one page

2012-03-21 Thread Cliff
Another approach, the one that I use, is to hide the various forms behind accordion folds. Or on different tabs. In either case, update the fields on the tab or fold being closed to avoid losing input. You can use ajax for this. On Mar 21, 12:16 am, weheh richard_gor...@verizon.net wrote:

[web2py] Re: 2 models / How can you call a model from different application?

2012-03-21 Thread Cliff
I have done what you want to do, but I won't do it again. Too complicated keeping the different versions of the model in synch. Also there are migration issues-- Consider putting everything into a single application. Check out this link: http://web2py.com/book/default/chapter/04#Cooperation

[web2py] Package max file size

2012-03-21 Thread Marco Tulio Cicero de M. Porto
Hi, Packages are a really cool feature. They allow you to backup your application (including all the tables, views, controllers, and also static files, uploads etc). I made an application that has some static maps (png images), and also made a few pdf files available for download. What happens

[web2py] Online book is down (producing internal error)

2012-03-21 Thread Anthony
When I try to access the book at http://web2py.com/book, I'm getting: Internal errorTicket issued: unrecoverablehttp://web2py.com/admin/default/ticket/unrecoverable

[web2py] Re: psycopg2.ProgrammingError: relation table_name already exists

2012-03-21 Thread Cliff
When you have multiple apps sharing a table, only one app should migrate the table. In my multii-app application, init owns and migrates all the auth tables because it handles logins. Other apps own the tables most pertinent to them. Non-owning apps can use the tables by defining them without

Re: [web2py] Re: psycopg2.ProgrammingError: relation table_name already exists

2012-03-21 Thread Bruce Wade
Yes I am aware of that. I just found sometimes as you are building a large app you may reorganize which app your models belong to. This is normally not an issue except when I have members testing the site. On Wed, Mar 21, 2012 at 7:27 AM, Cliff cjk...@gmail.com wrote: When you have multiple

[web2py] Re: Spatial / GIS support in DAL

2012-03-21 Thread DenesL
Could you provide more info on what are you trying to accomplish? where is your data and how it is stored, etc. The current DAL GIS implementation takes advantage of the built-in support provided in the DB for GIS data, be it PostGIS or MSSQL spatial support, without any additional dependencies

[web2py] Re: 2 models / How can you call a model from different application?

2012-03-21 Thread n1ck
Hm I see, so if you are building a system you just create single application, right? On Mar 21, 10:16 pm, Cliff cjk...@gmail.com wrote: I have done what you want to do, but I won't do it again.  Too complicated keeping the different versions of the model in synch. Also there are

Re: [web2py] Re: 2 models / How can you call a model from different application?

2012-03-21 Thread Bruce Wade
I have multiple applications. I have been moving more of my code into modules which defines tables that both applications may use. You can import a module in one application from a different application. There have been quite a few examples of this now. My system currently has 4 applications and

[web2py] Re: 2 models / How can you call a model from different application?

2012-03-21 Thread Cliff
The models-in-modules method certainly works. It is best suited for large applications, though. On Mar 21, 10:46 am, Bruce Wade bruce.w...@gmail.com wrote: I have multiple applications. I have been moving more of my code into modules which defines tables that both applications may use. You can

Re: [web2py] Re: 2 models / How can you call a model from different application?

2012-03-21 Thread Anthony
You can also now do: db = DAL(..., folder='path/to/app/databases/folder', auto_import=True) That will automatically define the database models of the external app based on the metadata stored in the .table files in the app's /databases folder. Note, that will only get you the field names and

[web2py] LinkedIn integration

2012-03-21 Thread Udi Milo
Hi, I've been trying for some time now to get linkedIn integrated into a web2py website running on GAE, but I can't make it work. (im a python beginner) Can someone please help me? here is what I did: - added linkedin.py + model.py (from python-linkedin) to modules. - added from

[web2py] Re: 2 models / How can you call a model from different application?

2012-03-21 Thread n1ck
Thank You Guys for all the help... :D

[web2py] Re: unit testing web2py and app engine

2012-03-21 Thread David Phillips
Thank you, howesc. I'll take a close look at your file. I finally cobbled together a file to unit test an object in my project that uses the unittest library, Google's memcache and the testbed library, and a web2py model. I am hoping it will scale up to test controller actions as well as

Re: [web2py] Re: Spatial / GIS support in DAL

2012-03-21 Thread Manuele Pesenti
Il 21/03/2012 15:37, DenesL ha scritto: Could you provide more info on what are you trying to accomplish? where is your data and how it is stored, etc. The current DAL GIS implementation takes advantage of the built-in support provided in the DB for GIS data, be it PostGIS or MSSQL spatial

[web2py] creating relationship between two tables

2012-03-21 Thread Derek
I'm using SQL 2005 and Web2py 1.99.4 Here's my db.py db.define_table('customers', Field('name', 'string',length=50), Field('sapID', 'string', length=10), Field('city', 'string',length=50), Field('state', 'string', length=2), Field('country','string',length=3),

[web2py] sqlite on production

2012-03-21 Thread Marco Tulio Cicero de M. Porto
is it ok to use sqlite for production? or is that not recommended? -- []'s Marco Tulio

Re: [web2py] sqlite on production

2012-03-21 Thread Vasile Ermicioi
I think it is ok for less than 100k page views/day, by enabling wal I think you can handle 1 million page views daily http://www.sqlite.org/whentouse.html Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite. The 100K hits/day figure is a conservative

[web2py] Re: sqlite on production

2012-03-21 Thread Derek
It is not recommended. All updates will lock the entire database, since it is designed for one user. Also, it does not scale. On Wednesday, March 21, 2012 10:11:02 AM UTC-7, Marco Tulio wrote: is it ok to use sqlite for production? or is that not recommended? -- []'s Marco Tulio On

[web2py] Re: unit testing web2py and app engine

2012-03-21 Thread David Phillips
I should have mentioned one other thing. Before running my unit test, I set the PYTHONPATH environment variable so that I could import the Google app engine libraries. export PYTHONPATH=~/dev/python/google/google_appengine_1.6.3_source/ google_appengine On Mar 21, 11:14 am, David Phillips

[web2py] Re: creating relationship between two tables

2012-03-21 Thread pbreit
I think it needs to be 'reference db.customers' Are these equivalent? Is there a preferred usage? db.define_table('dog', Field('owner', 'reference db.owner')) db.define_table('dog', Field('owner', db.owner))

[web2py] Re: Use DAL on local MySQL database

2012-03-21 Thread pbreit
I don't think you need to do anything special to access a local DB. What OS are you on? How have you installed Web2py (zip file? hg clone?). I'm on a Mac and access a MySQL DB through MAMP and the one wrinkle was that I needed to noodle around with mysql.sock connection. pymsql is in

[web2py] Re: Spatial / GIS support in DAL

2012-03-21 Thread DenesL
What is in the shape file?. On Mar 21, 1:09 pm, Manuele Pesenti manuele.pese...@gmail.com wrote: Il 21/03/2012 15:37, DenesL ha scritto: Could you provide more info on what are you trying to accomplish? where is your data and how it is stored, etc. The current DAL GIS implementation takes

[web2py] Re: Spatial / GIS support in DAL

2012-03-21 Thread DenesL
If you are referring to an ESRI shapefile then this might help: http://gis.stackexchange.com/questions/15920/how-to-convert-shapefile-geometries-to-wkb-using-ogr

[web2py] Environment variable LD_LIBRARY_PATH

2012-03-21 Thread surfnet3
How can I set the environment variable LD_LIBRARY_PATH for web2py?

[web2py] How to get pound sign in url or work around it?

2012-03-21 Thread Cliff
Here is a snippet of javascript code: window.location.href = {{=URL('edit', args=[request.args(0), '#tabs-2'])}}; Notice the '#' in the args list. URL persists in rendering the '#' as %23, which causes Web2py to throw an 'Invalid Request' page. I have tried using XML to preserve the pound sign,

Re: [web2py] How to get pound sign in url or work around it?

2012-03-21 Thread Jonathan Lundell
On Mar 21, 2012, at 12:49 PM, Cliff wrote: Here is a snippet of javascript code: window.location.href = {{=URL('edit', args=[request.args(0), '#tabs-2'])}}; Notice the '#' in the args list. URL persists in rendering the '#' as %23, which causes Web2py to throw an 'Invalid Request'

Re: [web2py] Re: sqlite on production

2012-03-21 Thread Vasile Ermicioi
It is not recommended. All updates will lock the entire database, since it is designed for one user. Also, it does not scale. enable wal (http://www.sqlite.org/draft/wal.html) and it will not lock Also, it does not scale do you have any numbers? at which point it doesn't scale?

[web2py] Re: Conditional Fields

2012-03-21 Thread Rakesh Singh
Hi Richard, My tables are pretty large (30-60 columns each), so let me use another test table. Let's say we have a table called survey. If the user selects Male in the Sex field, Favourite Car and Favourite Sport must not be empty. Favourite Perfume and Favourite Soapie can be empty. If the user

[web2py] efficient DB queries

2012-03-21 Thread Udi Milo
Hi, I have two db tables: board (name, created_on) article(board, name, title) currently, in my html I do a naive loop {{for article in articles}} {{=article.board.name}} {{pass}} I would like to change it and do something like: articles = db.select.all... board_ids = set(map(lambda a:

Re: [web2py] Re: DAL or SQL?

2012-03-21 Thread Keith Edmunds
I'm having problems getting a valid value for seconds() from a time field under Sqlite. I can extract a time: for row in db(db.t_periods.id==40).select(db.t_periods.f_period_end): ... print row ... Row {'f_period_end': datetime.time(17, 50, 51)} However, if I try to get the seconds(), it

[web2py] Re: efficient DB queries

2012-03-21 Thread Anthony
I have two db tables: board (name, created_on) article(board, name, title) currently, in my html I do a naive loop {{for article in articles}} {{= article.board.name}} {{pass}} I would like to change it and do something like: articles = db.select.all... board_ids = set(map(lambda

[web2py] Re: Possible error in datetime conversion?

2012-03-21 Thread Anthony
Try default='00:00 AM'. Though it looks like this could be a bug -- please submit an issue: http://code.google.com/p/web2py/issues/list Anthony On Tuesday, March 20, 2012 8:58:38 AM UTC-4, Youngblood wrote: I have an input field with a default value of 12:00 AM. In the database the field

Re: [web2py] Re: Spatial / GIS support in DAL

2012-03-21 Thread Manuele Pesenti
Il 21/03/2012 19:39, DenesL ha scritto: If you are referring to an ESRI shapefile then this might help: http://gis.stackexchange.com/questions/15920/how-to-convert-shapefile-geometries-to-wkb-using-ogr Hi, thanks for the very usefull link... but the object seams not to answer the quest. For

[web2py] Re: How to get pound sign in url or work around it?

2012-03-21 Thread Cliff
Thanks, Jonathan. I appreciate the hint. For anyone interested, there are a few more things you have to do. If you just add anchor='tabs-2' to URL(), it renders /bla/edit/ 5#tabs-2. Not an invalid request, but it doesn't get you to the anchor, either. So do something like URL(bla,

Re: [web2py] Re: DAL or SQL?

2012-03-21 Thread Niphlod
Wait seconds() is a method of a datetime field when you call the sum, the method is called, but if you are going to fetch it directly, you must use: rows = db(db.t_periods.id==40).select(db.t_periods.f_period_end) for row in rows: print row.f_period_end.seconds()

Re: [web2py] How to get pound sign in url or work around it?

2012-03-21 Thread Jonathan Lundell
On Mar 21, 2012, at 2:39 PM, Cliff wrote: For anyone interested, there are a few more things you have to do. If you just add anchor='tabs-2' to URL(), it renders /bla/edit/ 5#tabs-2. Not an invalid request, but it doesn't get you to the anchor, either. Just curious--why not? So do

[web2py] Re: sqlite on production

2012-03-21 Thread Cliff
SQLite scalability could be an issue over the lifetime of a web application because of size limits. From the SQLite web site at http://www.sqlite.org/whentouse.html: With the default page size of 1024 bytes, an SQLite database is limited in size to 2 terabytes (241 bytes). And even if it could

Re: [web2py] Re: DAL or SQL?

2012-03-21 Thread Keith Edmunds
On Wed, 21 Mar 2012 14:43:42 -0700 (PDT), niph...@gmail.com said: rows = db(db.t_periods.id==40).select(db.t_periods.f_period_end) for row in rows: print row.f_period_end.seconds() No, that gives an error: rows = db(db.t_periods.id==40).select(db.t_periods.f_period_end) for row in

[web2py] Re: How to get pound sign in url or work around it?

2012-03-21 Thread Cliff
Dunno. But it acts this way even if I type the url in the browser destination box by hand. Firefox 11.0 on Ubu Natty. Haven't tried it yet with Chromium or Opera. I'll confess to being ignorant about what the RFCs say about url formation. On Mar 21, 5:54 pm, Jonathan Lundell

Re: [web2py] Re: How to get pound sign in url or work around it?

2012-03-21 Thread Jonathan Lundell
On Mar 21, 2012, at 3:14 PM, Cliff wrote: Dunno. But it acts this way even if I type the url in the browser destination box by hand. Firefox 11.0 on Ubu Natty. Haven't tried it yet with Chromium or Opera. Odd. The RFC example has no slash. But that'd be a very strange bug for Firefox.

[web2py] Re: How to get pound sign in url or work around it?

2012-03-21 Thread Cliff
Okay, this is weird. It is working now. I swear it didn't work earlier. Maybe it's just more of my non-deterministic programming :). On Mar 21, 6:21 pm, Jonathan Lundell jlund...@pobox.com wrote: On Mar 21, 2012, at 3:14 PM, Cliff wrote: Dunno.  But it acts this way even if I type the url

[web2py] Re: efficient DB queries

2012-03-21 Thread Udi Milo
Anthony, Thanks for answering so quickly. I did mean board and not board_id My question is very basic. I know that the article table has an Id column that is really the board reference, but when I look at the result of the query and unification of: board_ids = set(map(lambda a: a.board,

[web2py] Re: efficient DB queries

2012-03-21 Thread Anthony
I didn't realize you were on GAE. I'm not quite sure how GAE handles this, so perhaps someone with more GAE experience can chime in. In an RDBMS, you should be able to do: board_ids = set([a.board for a in articles]) boards = db(db.boards.id.belongs(board_ids)).select() But not sure if that

[web2py] Re: SQLFORM deletable=True -- buggy behavior

2012-03-21 Thread weheh
Hi Anthony, I'm running 1.99.4 stable and I'm using the latest web2py_ajax.js that came with it. I have modified that web2py_ajax.js with the web2py_trap_form(action,target) function fix for uploading files with components. And yes, I do have multiple components on the page. On Mar 21, 8:47 pm,

[web2py] Re: efficient DB queries

2012-03-21 Thread Udi Milo
It doesn't. I found this: GAE does not support belongs and does not support OR. You have to do: rows = db(db.media_type.name=='paper').select()db (db.media_type.name=='cd').select() The is done at the web2py level but since records are exclusive and you are not sorting them, there is no

[web2py] Re: Spatial / GIS support in DAL

2012-03-21 Thread DenesL
You were too quick to dismiss it. There is also an exportToWkt in OGR: http://www.gdal.org/ogr/classOGRGeometry.html On Mar 21, 5:35 pm, Manuele Pesenti manuele.pese...@gmail.com wrote: Il 21/03/2012 19:39, DenesL ha scritto: If you are referring to an ESRI shapefile then this might help:

[web2py] auth.login() suggested enhancement

2012-03-21 Thread weheh
I'm wondering why auth.login() doesn't take many of the same arguments that SQLFORM takes (same goes for other auto-form-generators within web2py)? For instance, why not take the separator, buttons, formstyle ... arguments? Seems like they should work nicely within the framework of auth.login()

[web2py] Re: efficient DB queries

2012-03-21 Thread Anthony
I think that is outdated -- according to this (https://groups.google.com/d/msg/web2py/vWqOET74qg4/92DLUFTUsN0J), GAE does now support belongs but is limited to 30 items per query (so you have to break it up). Perhaps there is a better way, though. Anthony On Wednesday, March 21, 2012 9:26:44

[web2py] Re: SQLFORM deletable=True -- buggy behavior

2012-03-21 Thread Anthony
Can you show your modified web2py_trap_form function? Do you components by chance happen to reload web2py.js? It looks like somehow web2py_event_handlers() is getting called each time a component is loaded, so each handler is created multiple times. If web2py.js is loaded only once with the

[web2py] Re: auth.login() suggested enhancement

2012-03-21 Thread Anthony
auth.settings.formstyle auth.settings.label_separator auth.messages.login_button auth.messages.delete_label etc. See http://web2py.com/books/default/chapter/29/9#Settings-and-messages. Are there other useful arguments missing? If so, maybe auth.login (and the other methods) could take **kwargs

[web2py] Re: auth.login() suggested enhancement

2012-03-21 Thread weheh
Thanks, Anthony. I'm looking through the auth source as we speak and finding lots of useful stuff that doesn't appear in the doc. On Mar 22, 12:30 pm, Anthony abasta...@gmail.com wrote: auth.settings.formstyle auth.settings.label_separator auth.messages.login_button

[web2py] Re: efficient DB queries

2012-03-21 Thread Udi Milo
I went with: query = '' for id in board_ids: query += 'db(db.board.id==%d).select()|' %id query = query[:-1] boards = eval(query) I have no idea how to evaluate performance of that query though if you have any other ideas (I cannot limit 30 right now without

[web2py] Re: SQLFORM deletable=True -- buggy behavior

2012-03-21 Thread weheh
It's the code straight out of the new web2py cookbook. I'm not sure ... will I be violating copyright if I post it here? Hmm... On Mar 22, 12:22 pm, Anthony abasta...@gmail.com wrote: Can you show your modified web2py_trap_form function? Do you components by chance happen to reload web2py.js?

[web2py] Re: SQLFORM deletable=True -- buggy behavior

2012-03-21 Thread Anthony
It's the code straight out of the new web2py cookbook. I'm not sure ... will I be violating copyright if I post it here? Hmm... The code in this book is released under the BSD license, unless otherwise specified, and is available online on a dedicated GitHub repository listed below.