[web2py] how to use javascript code in web2py html pages?

2012-08-23 Thread Amit
Hi, I have html file with one text field with submit button inside form.I added javascript code to validate the textfield but its not working at all, why is it so? does web2py not support javascript function? please check below the code : function textFieldValidation() { var x=document.for

[web2py] About the Scheduler

2012-08-23 Thread Martin Weissenboeck
I have tried the examples found in the book and the scheduler works very fine as expected. But how to use it in "real life"? My questions: - I have written an application with contains only the scheduler. It woks, but does the scheduler need it's own application? What is the best way to c

Re: [web2py] Re: Google group again

2012-08-23 Thread apps in tables
in this page: https://groups.google.com/forum/?fromgroups=#!forum/web2py On Friday, August 24, 2012 7:05:49 AM UTC+3, apps in tables wrote: > > the upper right corner has the number of topics, above it the members > button , clicking it will show the members. > > On Friday, August 24, 2012 7:02

Re: [web2py] Re: Google group again

2012-08-23 Thread apps in tables
the upper right corner has the number of topics, above it the members button , clicking it will show the members. On Friday, August 24, 2012 7:02:03 AM UTC+3, Massimo Di Pierro wrote: > > How > Did > Yoy > Do > It > ? --

[web2py] Re: Trunk > 20012-08-19 formatting

2012-08-23 Thread Simon Ashley
The last issue resolved and re iteration of a warning to others. *Don't use more than one SQLFORM.grid on a form.* On Friday, 24 August 2012 12:32:01 UTC+10, Simon Ashley wrote: > > That's OK. > I'm not sure with the styling of the Export at bottom of the screen but no > biggy. > > The main is

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread apps in tables
what about the search? On Friday, August 24, 2012 7:00:27 AM UTC+3, Massimo Di Pierro wrote: > > You can always pickle a python dict in a text field in sql database > --

Re: [web2py] Re: Google group again

2012-08-23 Thread Massimo Di Pierro
How Did Yoy Do It ? --

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread Massimo Di Pierro
You can always pickle a python dict in a text field in sql database --

Re: [web2py] Re: Google group again

2012-08-23 Thread apps in tables
18252 topics --

Re: [web2py] Re: Google group again

2012-08-23 Thread apps in tables
4143 members --

Re: [web2py] Re: Google group again

2012-08-23 Thread apps in tables
web2py-users (Member) Interest in web2py, former Gluon (for users) http://www.web2py.com Developers should also join: http://groups.google.com/group/web2py-developers 18252 topics last post: 6:45 AM (7 minutes ago) web2py-developers

Re: [web2py] Re: Google group again

2012-08-23 Thread Jonathan Lundell
On 23 Aug 2012, at 7:37 PM, Anthony wrote: > I'm not sure it's possible any more. That's my impression. > On Thursday, August 23, 2012 10:11:36 PM UTC-4, Massimo Di Pierro wrote: > Does anybody know how to check how many members and how many posts are in > this group? > > --

Re: [web2py] SQLFORM key error

2012-08-23 Thread pylix
I'm an idiot... the software works fine I just forgot to name the model appropriately(it wasn't named like the controller). sorry for using up your resources on this silly mistake I'll try to troubleshoot more own my own in the future. On Thursday, August 23, 2012 9:49:14 PM UTC-4, Massimo Di Pie

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread apps in tables
* "A DBA walks into a NOSQL bar, but turns and leaves because he couldn't find atable" * Regarding nosql, I am interested in the benefit of not having a schema, specially, when it is complex and changing. I think this is the main advantage of nosql no schema means maximum flexibility. Th

[web2py] Re: prevent future date being selected

2012-08-23 Thread Stephen Logan
Thanks again Anthony! Thats perfect On Friday, 24 August 2012 14:42:04 UTC+12, Anthony wrote: > > Use the IS_DATE_IN_RANGE validator -- see > http://web2py.com/books/default/chapter/29/7#Validators for details. > Maybe something like: > > IS_DATE_IN_RANGE(maximum=request.now.date()) > > Anthony

[web2py] web2py nginx and uwsgi

2012-08-23 Thread FERNANDO VILLARROEL
Dear. I am new in web developing and always i used sample apache config. But i see many post about my subject, so I would like use it. Also I would like to integrate git to development environment, now i do using trac + svn for my standalone projects. I am following the follow howto: http://

Re: [web2py] Re: how to parse xml in web2py?

2012-08-23 Thread Amit
Thanks guys for helping me to write xml parsing in python..I will use ElementTree Or cElementTree to extract data from xml and let you people know about the outcome. @Anthony: My mistatke :( , I manually written the xml so did mistake on matching opening and closing tags. Thanks once again Amit

[web2py] Re: prevent future date being selected

2012-08-23 Thread Anthony
Use the IS_DATE_IN_RANGE validator -- see http://web2py.com/books/default/chapter/29/7#Validators for details. Anthony On Thursday, August 23, 2012 10:24:14 PM UTC-4, Stephen Logan wrote: > > Hi Guys > Having a crack at my first webapp and stuck on the model:( > > What i want to do is record how

[web2py] prevent future date being selected

2012-08-23 Thread Stephen Logan
Hi Guys Having a crack at my first webapp and stuck on the model:( What i want to do is record how far i have run on a particular day... QUESTION: how do i prevent a user from selecting a day in the future? as it is invalid Thanks in Advance Stephen --

[web2py] Re: Google group again

2012-08-23 Thread Anthony
I'm not sure it's possible any more. On Thursday, August 23, 2012 10:11:36 PM UTC-4, Massimo Di Pierro wrote: > > Does anybody know how to check how many members and how many posts are in > this group? --

[web2py] Re: Trunk > 20012-08-19 formatting

2012-08-23 Thread Simon Ashley
That's OK. I'm not sure with the styling of the Export at bottom of the screen but no biggy. The main issue that I'm working through is the a working app in a trunk from 2012-07-21 is broken in the current trunk. One issue appears to be related to the auth_users table. Would not play nicely w

[web2py] Re: Limit output of a "details" page to only show some items.

2012-08-23 Thread Anthony
> > def details(): > try: > equipment = db.equipment[int(request.args(0))] > except: > equipment = db(db.equipment.slug == > request.args(0)).select().first() > Note, db.equipment(request.args(0)) will attempt to convert request.args(0) to an integer, and if that doesn't

[web2py] Google group again

2012-08-23 Thread Massimo Di Pierro
Does anybody know how to check how many members and how many posts are in this group? --

[web2py] Re: Install in hostgator

2012-08-23 Thread pitonb
Sorry to revive this thing a year later. I have taken a stab at this yesterday and at 5 in the morning I was still nowhere trying to install w2p under a shared hosting account. Has anyone gotten this to work on hostgator? I would really appreciate some help. I have pretty much vacuumed the web

[web2py] Re: Trunk > 20012-08-19 formatting

2012-08-23 Thread Massimo Di Pierro
Yes. The grid was an experimental feature in 1.99.7. We are still making minor tweaks to it. The query button is gone because its effect can be achieved by giving focus to the search input. The add button moved up to save space. The export feature has been improved. There are many export options

Re: [web2py] SQLFORM key error

2012-08-23 Thread Massimo Di Pierro
We have posted some broken web2py version to perform some experiments. You may have gotten one of them. Download it again now. It is a release candidate and should be better than 1.99.7. On Thursday, 23 August 2012 20:17:02 UTC-5, pylix wrote: > > 1.99.7 stable i think it's the latest downloade

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread Massimo Di Pierro
I like to see it this way and perhaps I am wrong... They way you search on a database is using indexes. Indexes are trees (binary trees or b-trees, etc). They fast because the depth of the tree is log(N) where N is the number of the elements. You can insert, delete and search for items in tree

[web2py] Trunk > 20012-08-19 formatting

2012-08-23 Thread Simon Ashley
Its appears that SQLFORM.grid formatting has changed recently in the trunk: (with no change to the application) - The Query button has been dropped, - Add button moved to on top of the query field. - Export function changed from before the table to after with hyperlinks options rath

Re: [web2py] SQLFORM key error

2012-08-23 Thread pylix
1.99.7 stable i think it's the latest downloaded it recently but i'm on a windows machine, maybe that's the issue? On Thursday, August 23, 2012 9:04:41 PM UTC-4, rochacbruno wrote: > > web2py version?? > > > On Thu, Aug 23, 2012 at 10:00 PM, pylix >wrote: > >> Here's my model >> >> db = DAL('sqlit

Re: [web2py] SQLFORM key error

2012-08-23 Thread Bruno Rocha
web2py version?? On Thu, Aug 23, 2012 at 10:00 PM, pylix wrote: > Here's my model > > db = DAL('sqlite://storage.sqlite') > db.define_table('person', > Field('name', requires=IS_NOT_EMPTY()), > Field('phone', requires=IS_NOT_EMPTY()), > Field('address', requires=IS_NOT_EMPTY()), >

[web2py] SQLFORM key error

2012-08-23 Thread pylix
Here's my model db = DAL('sqlite://storage.sqlite') db.define_table('person', Field('name', requires=IS_NOT_EMPTY()), Field('phone', requires=IS_NOT_EMPTY()), Field('address', requires=IS_NOT_EMPTY()), Field('city', requires=IS_NOT_EMPTY()), Field('state', requires=IS_IN_SET(['

Re: [web2py] Limit output of a "details" page to only show some items.

2012-08-23 Thread SeamusSeamus
Oh, very easy! Web2y is great! On Thursday, August 23, 2012 6:48:30 PM UTC-6, rochacbruno wrote: > > Considering this: > > def details(): > try: > equipment = db.equipment[int(request.args(0))] > except: > equipment = db(db.equipment.slug == request.args(0)).select(). > fir

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread Niphlod
Without hitting a "product vs product" issue... nosql dbs is just another tool at the programmers belt. The "usually advertised benefits" are raw speed and scalability. On Friday, August 24, 2012 2:01:03 AM UTC+2, apps in tables wrote: > > > I think my problem is that my mind has been thinking

Re: [web2py] Limit output of a "details" page to only show some items.

2012-08-23 Thread Bruno Rocha
Considering this: def details(): try: equipment = db.equipment[int(request.args(0))] except: equipment = db(db.equipment.slug == request.args(0)).select(). first() return dict(equipment=equipment) Your view details.html should be {{=equipment.title}} {{=equipment.des

[web2py] Limit output of a "details" page to only show some items.

2012-08-23 Thread SeamusSeamus
I am trying to set a nice clean "details" page that only shows some basic information for a product. I do not want ALL information that is being storded (such as my slug, private notes field, etc..) to be visable to the customer. Now, I have this: def details(): try: equipment = db.

[web2py] Re: How to ask how many active sessions?

2012-08-23 Thread weheh
On Thursday, August 23, 2012 4:11:51 PM UTC+8, Niphlod wrote: > > define "active" session.active users, loginned users, peoples > wandering in your site ? Depends on info available. But all of the above, at least. --

[web2py] Questions on instantpress

2012-08-23 Thread Andrew
Hello (Martin), What's the best way to ask questions about InstantPress ? Here ? I would like to use it for a local Scout group website. Also, the old version is still at http://code.google.com/p/instant-press/ without any comments or links to the new bitbucket version. Should this one be dro

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread apps in tables
> I think my problem is that my mind has been thinking for thirty years about applications in the sql database way. I don't know what the nosql database application structure will look like. this is not the problem of web2py web2py is full stack framework ( based on sql-like database (DA

Re: [web2py] Re: fpdf upgrade and contib/generics.py

2012-08-23 Thread Andrew
In the console: "The system cannot find the path specified." I'm just trying to do a "Hello World" pdf . On Friday, August 24, 2012 11:29:52 AM UTC+12, Mariano Reingart wrote: > > What error does occur? > Does it throw an exception? > > I think It should work, but note that pdf conversion is si

Re: [web2py] Re: SEO Friendly URLs and Page Titles

2012-08-23 Thread SeamusSeamus
Thanks, that worked. I just added db.equipment.slug to the fields On Thursday, August 23, 2012 1:18:16 AM UTC-6, Anthony wrote: > > links = [lambda ro >> w: A('Details',_href=URL('default','show', args=[row.slug]))] >> fields = [db.equipment.category, db.equipment.title, >> db.equipment.

[web2py] Re: Grid, NameError: name 'auth' is not defined

2012-08-23 Thread Simon Ashley
Yep, sorry about that (was trying to post something quick to illustrate the issue). Part of the issue appears to be the db.auth_user table. Deleted and manually rebuilt it, and the error disappeared. Its appears that the latest trunk maybe have broken a callback link (reloads the calling form ra

Re: [web2py] Re: fpdf upgrade and contib/generics.py

2012-08-23 Thread Mariano Reingart
What error does occur? Does it throw an exception? I think It should work, but note that pdf conversion is simple, if you have a complex html, you'll need more advanced tools. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Thu, Aug 23, 2012 at 6

[web2py] Re: Twitter Bootstrap scatfolding application *updated.

2012-08-23 Thread Anthony
> > It is based on anytime.js > And note, anytime.js requires a commercial license for use on any commercial website. Anthony --

[web2py] food for thought....

2012-08-23 Thread Massimo Di Pierro
http://tent.io/ http://www.nicollet.net/2012/08/tent-the-right-goals-the-wrong-perspective/ https://github.com/pdxwebdev/yadapy --

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread Massimo Di Pierro
Exactly. In web2py one can use mongo db in two ways: 1) using the pymongo apis directly. It does not need the DAL and does not need them. They would get in the way. 2) using the DAL and "pretend" you have a sql-like table structure on top of mongo. You have to db.define_table(s) and you can quer

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Massimo Di Pierro
No without making non-lazy table significatively slower. On Thursday, 23 August 2012 15:32:08 UTC-5, Anthony wrote: > > OK, that makes sense. I guess there's no good way to make that lazy at the > Field level. > > Thanks. > > Anthony > > On Thursday, August 23, 2012 4:10:23 PM UTC-4, Massimo Di P

[web2py] Re: Twitter Bootstrap scatfolding application *updated.

2012-08-23 Thread Massimo Di Pierro
Martin, it is really well done but, as it is, it not appropriate for out scaffolding app. First of all it relies on many bootstrap specific helpers. Menus work in a different way than documented. Flash has a more complex html structure and does not provide a good example for new users. It is b

[web2py] Re: General knowledge questions about reference fields

2012-08-23 Thread Mike Girard
Every question answered. Thanks a lot, Anthony! On Thursday, August 23, 2012 3:27:07 PM UTC-4, Anthony wrote: > > 1. When you do a select that includes a reference field, how does it >> fetch, say, the name column, when only the id column is in the table you >> are doing a select on? >> > > Unle

[web2py] Re: fpdf upgrade and contib/generics.py

2012-08-23 Thread Andrew
Sorry, that should be contrib/generics.py Is views/generics.pdf working for others ? I might be doing someting wrong, but it's not working for me. On Friday, August 24, 2012 8:30:17 AM UTC+12, Andrew wrote: > > Does genereics.py need to be updated ? > > from gluon.contrib.pyfpdf import FPDF, H

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread Vasile Ermicioi
> If thats true, then NoSQL support isnt yet ready. > > in web2py you define TABLES which have FIELDS, and NoSQL support in web2py means that you are running your models on top of a NoSQL database (e.g. MongoDB) there is not yet support for queries like db(db.user.country.name ='US').select() but

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Anthony
OK, that makes sense. I guess there's no good way to make that lazy at the Field level. Thanks. Anthony On Thursday, August 23, 2012 4:10:23 PM UTC-4, Massimo Di Pierro wrote: > > Here is an example: > > Say you have > > db.define_table('person',Field('name')) > db.person.name.requires=IS_IN_SE

[web2py] fpdf upgrade and contib/generics.py

2012-08-23 Thread Andrew
Does genereics.py need to be updated ? from gluon.contrib.pyfpdf import FPDF, HTMLMixin Could this reference occur elsewhere ? --

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Massimo Di Pierro
Here is an example: Say you have db.define_table('person',Field('name')) db.person.name.requires=IS_IN_SET(build_set()) where build_set is computationally expensive. You only want to create the set if you actually need the table. You can move it in the controller action but does it belong ther

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread Pystar
If thats true, then NoSQL support isnt yet ready. On Thursday, August 23, 2012 8:31:31 PM UTC+1, Vasile Ermicioi wrote: > > you can use it but without dal and you lose all great features like form > generation and others --

[web2py] Re: Web2Py in cluster and DATABASES folder

2012-08-23 Thread Mike
Thanks, Massimo, that's exactly the code I've written, using migrate_enabled parameter in DAL constructor. The files will be created once, in that sub-folder, when the schema is first created and initialized with tables. I might need those files late for migrations and, regardless, I don't see t

[web2py] Using Request_tenant , but shows all records in the table

2012-08-23 Thread Saba Kazi
I've added the field request_tenant using : if auth.user: defaultval = auth.user.id else: defaultval = 0 db._common_fields.append(Field('request_tenant',default=defaultval)) While create a new record , the default value is inserted into the table, But when i view the records from the

Re: [web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread Vasile Ermicioi
you can use it but without dal and you lose all great features like form generation and others --

[web2py] Re: NoSQL Question Again!!!

2012-08-23 Thread apps in tables
> > > db=DAL('mongodb://127.0.0.1:5984/db') > > (the port may be different). Everything else should work as usual.. > > > Hi massimo, I think the point is not working as usual. 'usual' is to define tables . In Mongodb 'not usual' , there is no schema. Please, explain How to use the mongodb f

[web2py] Re: General knowledge questions about reference fields

2012-08-23 Thread Anthony
> > 1. When you do a select that includes a reference field, how does it > fetch, say, the name column, when only the id column is in the table you > are doing a select on? > Unless you do a join, it does not fetch the "name" column (presumably you mean the "name" column of the referenced tabl

Re: [web2py] Re: Twitter Bootstrap scatfolding application *updated.

2012-08-23 Thread Bruno Rocha
Put z-index: 0; on flash alert On Thu, Aug 23, 2012 at 4:05 PM, David Marko wrote: > The alert 'Well done! ...' conflicts somehow with menu when you click e.g. > on 'Bootstrap' menu item ... > > Dne čtvrtek, 23. srpna 2012 20:48:03 UTC+2 Martin.Mulone napsal(a): > >> Twitter Bootstrap scatfoldi

[web2py] Re: Twitter Bootstrap scatfolding application *updated.

2012-08-23 Thread David Marko
The alert 'Well done! ...' conflicts somehow with menu when you click e.g. on 'Bootstrap' menu item ... Dne čtvrtek, 23. srpna 2012 20:48:03 UTC+2 Martin.Mulone napsal(a): > > Twitter Bootstrap scatfolding application *updated. > > Now is awesome :-P > > * Now based on version 2.1.0 (sync) > * Me

Re: [web2py] Twitter Bootstrap scatfolding application *updated.

2012-08-23 Thread Bruno Rocha
Great! This new navbar is very better! Thank you Martin! On Thu, Aug 23, 2012 at 3:48 PM, Martín Mulone wrote: > Twitter Bootstrap scatfolding application *updated. > > Now is awesome :-P > > * Now based on version 2.1.0 (sync) > * Menu based on twitter bootstrap navbar (support multilevel menu

[web2py] General knowledge questions about reference fields

2012-08-23 Thread Mike Girard
Still working on optimizing updates. Could someone provide high-level answers to the following? 1. When you do a select that includes a reference field, how does it fetch, say, the name column, when only the id column is in the table you are doing a select on? 2. For many-to-many relationship

[web2py] Twitter Bootstrap scatfolding application *updated.

2012-08-23 Thread Martín Mulone
Twitter Bootstrap scatfolding application *updated. Now is awesome :-P * Now based on version 2.1.0 (sync) * Menu based on twitter bootstrap navbar (support multilevel menu) * Plugin highlight. * Many fixes to layout now support responsive. * Very clean layout. * Started to document (getting) * S

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Anthony
> > I'd also still be interested to see a real-world example of where this >> would be useful. >> >> Anthony >> > > Someone posted an example of GAE CPU Cycles, with class based Lazy Tables > it lower to half cycles. Also there is another user in the group which has > a huge traffic, so Lazy ta

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Bruno Rocha
On Thu, Aug 23, 2012 at 3:11 PM, Anthony wrote: > I'd also still be interested to see a real-world example of where this > would be useful. > > Anthony > Someone posted an example of GAE CPU Cycles, with class based Lazy Tables it lower to half cycles. Also there is another user in the group whi

[web2py] Re: custom built login form

2012-08-23 Thread Anthony
Can you show some code or provide a little more detail regarding what you're trying to do? On Thursday, August 23, 2012 12:39:47 PM UTC-4, shartha wrote: > > Sorry for being out of touch. I discovered what was causing the issue > initially. If I try to assign a value to the id or name attributes

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Anthony
I'd also still be interested to see a real-world example of where this would be useful. Anthony On Thursday, August 23, 2012 12:19:24 PM UTC-4, Jonathan Lundell wrote: > > On 23 Aug 2012, at 9:16 AM, Massimo Di Pierro > > > wrote: > > Isn't that what my code does? > > In the example I used a l

[web2py] Re: Web2Py in cluster and DATABASES folder

2012-08-23 Thread Massimo Di Pierro
If they share the database, they should also share the folder. Anyway, mind that file IO is a major bottleneck and accessing a shared filesystem is every worse. Setting migrate=False prevents the file system access completely. Ideally should have a way to set migrate=True only when the new org

[web2py] Re: Web2Py in cluster and DATABASES folder

2012-08-23 Thread Mike
Perhaps I haven't made myself clear enough... Forget about development environment - think cluster deployment scenario only. I can't create databases in advance - in fact, the server code is written to create a new schema (using MySQL parlance) every time a new group of customers (an "organizat

[web2py] Re: Web2Py in cluster and DATABASES folder

2012-08-23 Thread Niphlod
ehm... deploy. production. cluster. You say that "some .table files are created" hence I think you're using the same database uri both for production and development (if any). If .table files are created, it's safe to assume that the underlying code changes too, right ? If so, a simply copy/rsyn

[web2py] Re: custom built login form

2012-08-23 Thread shartha
Sorry for being out of touch. I discovered what was causing the issue initially. If I try to assign a value to the id or name attributes of any of the login form elements, the form.cust.widget will not work as expected. So if you have any insight into this, please let me know as it'd be helpful

[web2py] Re: Access layout file in another application

2012-08-23 Thread curiouslearn
Thanks, Anthony. I will also go with the method you showed. On Thursday, August 23, 2012 11:05:44 AM UTC-4, Anthony wrote: > > I think I would use the method I showed rather than links. > > Anthony > --

[web2py] Re: how to save the id when passing a dict in an insert

2012-08-23 Thread puercoespin
El jueves, 23 de agosto de 2012 15:50:41 UTC+2, Anthony escribió: > > Do you have an existing dict and you need to insert it as a record, but > also want the record id? In that case, you can do: > > id = db.person.insert(**some_dict) > > Anthony > Thanks Antony! That works. I tried: id=db

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Jonathan Lundell
On 23 Aug 2012, at 9:16 AM, Massimo Di Pierro wrote: > Isn't that what my code does? > > In the example I used a lambda instead of a function but the implementation > should be exactly what you say. Perhaps I misunderstood. Or maybe I did. I'll have a chance to look at it more closely later. L

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Massimo Di Pierro
Isn't that what my code does? In the example I used a lambda instead of a function but the implementation should be exactly what you say. Perhaps I misunderstood. BTW. Auth is now fully lazy, when DAL(lazy_tables=True), and therefore should be faster. Needs testing and benchmarking. massimo

[web2py] Re: Extra field not getting validated.

2012-08-23 Thread Massimo Di Pierro
No problem. I prefer false positive than false negative. It means people are using and checking. ;-) On Thursday, 23 August 2012 07:52:08 UTC-5, Rujaun Fourie wrote: > > Sorry for wasting your time Massimo > > db.auth_user.nickname.requires = IS_NOT_IN_DB(db, 'auth_user.nickname') > > was the va

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Jonathan Lundell
On 23 Aug 2012, at 8:39 AM, Anthony wrote: > Couple of things (including questions). > > 1. attributes defined in the Field() spec are lazy already, right? > > I guess not so much "lazy", but for the most part all that happens is they > get added as attributes to the Field's self. There is a li

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Anthony
> > Couple of things (including questions). > > 1. attributes defined in the Field() spec are lazy already, right? > I guess not so much "lazy", but for the most part all that happens is they get added as attributes to the Field's self. There is a little logic in the constructor, though. I sup

[web2py] Web2Py Cookbook - Designing modular applications CORRECTION

2012-08-23 Thread Fred Kornyev
Hello! I was not able to find this information in one place so I had to piece it together, so I thought I would share it here: On page 94 in the Cookbook the "Designing modular applications" example has some mistakes and consequently the new item is not displayed automatically when using the c

[web2py] Web2Py in cluster and DATABASES folder

2012-08-23 Thread Mike
We are planning on deploying our Web2Py application under Apache-WSGI on a cluster of servers all accessing the same multiple databases. Since the new databases will be created on the fly, as needed, we cannot predict beforehand how many we will end up using and, consequently, how many files wil

[web2py] Re: how to parse xml in web2py?

2012-08-23 Thread villas
If the XML is not well-formed, take a look at beautiful soup. I have never found a parser so tolerant and forgiving. On Thursday, August 23, 2012 2:59:25 PM UTC+1, Anthony wrote: > > For simple parsing, you can also use the built-in TAG() helper -- see > http://web2py.com/books/default/chapter

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Jonathan Lundell
On 23 Aug 2012, at 7:48 AM, Anthony wrote: > db = DAL(lazy_tables=True) > db.define_table('person',Field('name'),Field('age','integer'), >on_define=lambda table: [ >table.name.set_attributes(requires=IS_NOT_EMPTY(),default=''), > > table.age.set_attributes(requires=IS_I

[web2py] Re: Access layout file in another application

2012-08-23 Thread Anthony
I think I would use the method I showed rather than links. Anthony On Thursday, August 23, 2012 10:54:11 AM UTC-4, curiouslearn wrote: > > Thank you, Anthony. That worked well. > > Do you have an opinion on which is a better method (in terms of easier to > maintain, less problems that I cannot

[web2py] how to parse xml in web2py?

2012-08-23 Thread Mike Girard
ElementTree or cElementTree are good. CElementTree is said to be faster. The most important thing is the method you use. If your sample is the extent of the document, any parser will do. However, if your actual documents are large, you should consider an iterparsing method to conserve memory.

[web2py] Re: Access layout file in another application

2012-08-23 Thread curiouslearn
Thank you, Anthony. That worked well. Do you have an opinion on which is a better method (in terms of easier to maintain, less problems that I cannot foresee given my lack of experience building web apps): the links of using extend as suggested? Thanks again. On Thursday, August 23, 2012 10:3

[web2py] Internal ip to external access

2012-08-23 Thread Gerald Klein
Hi all, I was wondering if anyone could direct me to a resource that will outline the techniques used to grant external access to an internal ip, along the lines of NetMeeting. I have tried to google and not getting a lot of traction on the subject, if someone knows a resource that would be great.

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Anthony
> > db = DAL(lazy_tables=True) > db.define_table('person',Field('name'),Field('age','integer'), >on_define=lambda table: [ >table.name.set_attributes(requires=IS_NOT_EMPTY(),default=''), > > table.age.set_attributes(requires=IS_INT_IN_RANGE(0,120),default=30), > ]) >

[web2py] Re: Access layout file in another application

2012-08-23 Thread Anthony
{{extend ...}} takes a file path, not a URL, and it needs to be relative to the current application's /views folder. So you can use directory traversal to get to the other layout: {{extend '../../myadminapp/views/default/mylayout.html'}} The ../../ will go up two levels from /applications/curre

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Massimo Di Pierro
So now in trunk you can do: db = DAL(lazy_tables=True) db.define_table('person',Field('name'),Field('age','integer'), on_define=lambda table: [ table.name.set_attributes(requires=IS_NOT_EMPTY(),default=''), table.age.set_attributes(requires=IS_INT_IN_RANGE(0,120),default=

[web2py] Access layout file in another application

2012-08-23 Thread curiouslearn
Hello, I searched on the forums here and it appears that the suggested solution for accessing a layout file is to create links (hard links or soft links?). I have two questions in this regard: (i) Is this solution robust to changes in where the application is hosted? Would the links works reg

[web2py] Re: how to parse xml in web2py?

2012-08-23 Thread Anthony
For simple parsing, you can also use the built-in TAG() helper -- see http://web2py.com/books/default/chapter/29/5#Parsing. FYI, in your example, some of the closing tags do not match their associated opening tags. Anthony On Thursday, August 23, 2012 5:53:32 AM UTC-4, Amit wrote: > > Hi, > I

[web2py] Re: how to save the id when passing a dict in an insert

2012-08-23 Thread Anthony
Do you have an existing dict and you need to insert it as a record, but also want the record id? In that case, you can do: id = db.person.insert(**some_dict) Anthony On Thursday, August 23, 2012 3:30:44 AM UTC-4, puercoespin wrote: > > Hi > > if ""db.person.insert(name='Juan',age=23)"" is

Re: [web2py] Re: App Cookbook friends.html - no such column: auth_user.first_name

2012-08-23 Thread Patrick Ryan
Thanks, Massimo. I studied the ticket a little more closely, and it looks like it was a problem with the controller. I had: *friends = db(Link.target==me).select(orderby=alphabetical)* But the "alphabetical" variable stores a query that references db.auth_user, so I changed it to: *friends = db

[web2py] Re: Automatically login after account creation

2012-08-23 Thread Anthony
If account creation is not going through the usual registration process (i.e., calling auth.register()), you can programmatically log in the user by calling auth.login_bare([email address], [password]) -- so you will need to generate a temporary password. Anthony On Thursday, August 23, 2012 8

[web2py] Re: Extra field not getting validated.

2012-08-23 Thread Rujaun Fourie
Sorry for wasting your time Massimo db.auth_user.nickname.requires = IS_NOT_IN_DB(db, 'auth_user.nickname') was the validator I used. But I forgot to mention that down the line I have: db.auth_user.nickname.requires = IS_NOT_EMPTY() And that messed it up. --

[web2py] Re: Automatically login after account creation

2012-08-23 Thread Massimo Di Pierro
auth.settings.registration_requires_verification = True # 2 auth.settings.login_after_registration = True # 3 On Thursday, 23 August 2012 07:00:43 UTC-5, Daniel Gonzalez wrote: > > Hi, > > I would like to implement the following flow: > >1. The user provides his email address, and clicks "re

[web2py] Re: URL() on *.load page

2012-08-23 Thread tomasz bandura
... extension=False this is a little confusing ( it is appended to the function ), but it works 2012/8/23 tomasz bandura > Hello, > > How to properly generate url on LOAD page (with ajax=False)? > > Image html tag: > > > Is rendered as: > > > Regards, > Tomasz --

[web2py] Re: Extra field not getting validated.

2012-08-23 Thread Massimo Di Pierro
Some days yet and some days no. Today yes. On Thursday, 23 August 2012 02:39:01 UTC-5, Rujaun Fourie wrote: > > Sorry if this is a stupid question but can I use the trunk in a production > enviroment? --

[web2py] Re: Accessing db['auth_user'] raises exception

2012-08-23 Thread Massimo Di Pierro
What's wrong with the grid? On Wednesday, 22 August 2012 23:52:01 UTC-5, Simon Ashley wrote: > > Noted and confirmed. > Must be a different issue. > Will investigate further and raise on a new thread. > > The current situation is that the application/ grid works fine on a trunk > from 2012-07-

  1   2   >