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

2012-08-17 Thread pbreit
I suppose you could use URL(a=??) in order to share those files across apps although I think that's fairly uncommon. I find that I learn SQL even as I use DAL. But if you still do want to use raw SQL you can use the DAL's db.executesql() function. But you lose a ton of DAL functionality. --

[web2py] T function and database records - html entities

2012-08-17 Thread Calycé
Hi all, I'm using the T function to produce some text in a multilingual application, but I'm facing a small problem. If i use T('Aller à') I receive the exact same string but when using T(' blabla') I receive 'gt; blabla'. In the second case the greater than sign is correctly rendered in html

[web2py] Re: web2py.app runs live from Dropbox - and backups on dropbox

2012-08-17 Thread Luc Chase
lol, cool. Incidently, Dropbox is also a Python app. On Wednesday, 15 August 2012 16:57:24 UTC+1, Rob_McC wrote: *Just for information... * I backup my web2py files (.app) on dropbox free account https://www.dropbox.com/ This works well for me as a clould solution, quick, easy and

[web2py] Re: web2py.app runs live from Dropbox - and backups on dropbox

2012-08-17 Thread villas
As you say, it shouldn't be a surprise because the dropbox folder is just like any other folder, but it also seems like a good solution for anyone working alone and using the same dev system at home and the office. --

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

2012-08-17 Thread villas
Tar is simply to decompress the folder. On windows I believe you could for example use 7-zip http://www.7-zip.org to do that. On Friday, August 17, 2012 6:29:59 AM UTC+1, jayvandal wrote: I put my applications in c:/python27/projects i make my application = cars I change my directory

Re: [web2py] Auth with Google Oauth2 - Google Plus, Gmail and other scopes

2012-08-17 Thread Alec Taylor
Hi Bruno, Can we get an update on this? Thanks On Tuesday, January 17, 2012 4:44:16 AM UTC+11, rochacbruno wrote: yes we can! the difference is only some keys passed to auth and token url, also the redirect page and the api caller. I think we can create an api proxy to decide which class

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

2012-08-17 Thread villas
Hi Rob I hope Massimo will consider to incorporate this into Welcome. It is much to the credit of web2py that security is given top priority and it is apt that the default scheme should be a thoughtful implementation. A well thought out Auth configuration is useful to everyone and the fact

[web2py] Best way to insert 200k records?

2012-08-17 Thread Mike Girard
Hello: What is the prescribed method for doing large bulk inserts? I am using sqllite as my backend. Is it ok to just write a Python script that talks to the db directly or should the DAL be used? The book says the bulk_insert method is not more advantageous than a for loop. I searched

[web2py] Catch rows in Javascript

2012-08-17 Thread Mathias
Hi, How can I catch rows in Javascript code ? Thanks Mathias --

Re: [web2py] Best way to insert 200k records?

2012-08-17 Thread vinicius...@gmail.com
Maybe you can face transaction size problems with this volume. Web2py, by default, just commits after a successful transaction. So, try to db.commit() after some transaction completion identification. But I think processing time wouldn't be your problem. -- Vinicius Assef On 08/17/2012

Re: [web2py] Best way to insert 200k records?

2012-08-17 Thread Mike Girard
But what method should I use? Is there anything better than bulk_insert? Naturally I would like this to work as fast as possible. Thanks. --

[web2py] Re: Best way to insert 200k records?

2012-08-17 Thread weheh
You can enter either via db(query).insert(name=value, ...) or by a CSV file. Both are convenient. I suppose you could argue that CSV is convenient if your data are dumped from some other db without computing an intermediate value. If your data are less clean, perhaps, or you need to do some

Re: [web2py] Best way to insert 200k records?

2012-08-17 Thread vinicius...@gmail.com
I'd choose bulk_insert, but you should run some benchmarks, too. On 08/17/2012 09:08 AM, Mike Girard wrote: But what method should I use? Is there anything better than bulk_insert? Naturally I would like this to work as fast as possible. Thanks. --

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

2012-08-17 Thread weheh
CSS belongs under static. Packages and common routines belong under modules and are imported. You could have a common static and modules and symbolically link. I have never done that, but it makes sense. I suppose you could also put the CSS just about anywhere on the file system. And modules

Re: [web2py] Re: Back-and-forth between DAL SQLAlchemy

2012-08-17 Thread Larry G. Wapnitsky
Thanks, Massimo. I'll give this a read and see if I can adapt it properly. As usual, your hard work is greatly appreciated. On 8/15/2012 6:34 PM, Massimo Di Pierro wrote: I meant this: http://web2py.com/AlterEgo/default/show/189 On Wednesday, 15 August 2012 14:22:36 UTC-5, Larry Wapnitsky

Re: [web2py] Best way to insert 200k records?

2012-08-17 Thread Vasile Ermicioi
I would do commit after each 1 inserts data #some array of dicts for i in xrange(len(data)): db.table.insert(**data[i]) if i%1==0: db.commit() db.commit() --

[web2py] Re: Best way to insert 200k records?

2012-08-17 Thread Mike Girard
The data will be coming from a large XML file, so my script will parse that and make inserts into several different tables. It's fairly straightforward. So is it correct to say that - 1. There is no compelling reason to do this without the DAL 2. My options in the DAL are bulk_insert, looping

[web2py] How to email attachment with original filename

2012-08-17 Thread Cliff Kachinske
How can I email uploaded files with the original file name? I realize it is possible to make a copy of the file with the original name and attach that, but that seems like a waste of resources. Is there a better way? thanks, Cliff Kachinske --

[web2py] Re: How to email attachment with original filename

2012-08-17 Thread Larry Wapnitsky
I'm currently storing the files as BLOBs in MySQL along with a field for the filename. That has been working for me. On Friday, August 17, 2012 8:35:38 AM UTC-4, Cliff Kachinske wrote: How can I email uploaded files with the original file name? I realize it is possible to make a copy of the

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

2012-08-17 Thread Rob_McC
Thanks David and Anthony: 1- I will reorder validtors for final example, most common ones first. 2- Good suggestion: I'll try to write a web2pyslices, I like that site a lot as it can offer more complete solutions than these discussions often do. 2- A validator? *Question:* Would it

[web2py] Re: Electronic voting anybody?

2012-08-17 Thread Rob_McC
Thanks Massimo for your attention to matter. Note 1) is actually a feature. All ballots are always public. OK, I get it it just with real elections, ballots are secret, and handled with such care... but... maybe electronic voting is different... *However *For the public to know

[web2py] Re: How to email attachment with original filename

2012-08-17 Thread Niphlod
Attachments take an optional parameter to specify the filename, so what is your current problem ? You have the original name on the table, you have the path on the table, you have the file in the uploads directory. Seems to me that you don't have to copy anything around

[web2py] Congratulations to Bruno and Mariano

2012-08-17 Thread Massimo Di Pierro
Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations. http://pyfound.blogspot.com.br/2012/08/welcome-new-psf-members.html --

[web2py] Re: Electronic voting anybody?

2012-08-17 Thread villas
I like this idea, but when I tried it, this happened: I set up a ballot and received an email, I clicked the link and got the voting page. I voted but immediately received a ticket. --

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Omi Chiba
Congrats ! On Friday, August 17, 2012 9:13:45 AM UTC-5, Massimo Di Pierro wrote: Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations. http://pyfound.blogspot.com.br/2012/08/welcome-new-psf-members.html --

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

2012-08-17 Thread Rob_McC
Still trying to make my username example, google-like. Google prohibits a very small set of bad words. I have a BADWORDS working outside of the validation, but when I insert in validation, I get error. Any help would be appreciated, I bet it is one little thing :) I get error type

[web2py] Re: Help me to write SQL query in web2py

2012-08-17 Thread Massimo Di Pierro
You can try this: from gluon.dal import Expression t = db.abc_tbl max_created_on = t.max() query = Expression(db,date_sub(now(), interval interval_time minute)) db(query).select(t.device_id,t.sensor_id,t.max(),group_by=t.device_id|t.sensor_id) On Thursday, 16 August 2012 23:01:44 UTC-5, Amit

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

2012-08-17 Thread Jonathan Lundell
On 17 Aug 2012, at 7:18 AM, Rob_McC mrmccorm...@gmail.com wrote: Still trying to make my username example, google-like. Google prohibits a very small set of bad words. I have a BADWORDS working outside of the validation, but when I insert in validation, I get error. Any help would be

[web2py] Re: Electronic voting anybody?

2012-08-17 Thread Massimo Di Pierro
Sorry. I was editing the code live. Try now. On Friday, 17 August 2012 09:15:56 UTC-5, villas wrote: I like this idea, but when I tried it, this happened: I set up a ballot and received an email, I clicked the link and got the voting page. I voted but immediately received a ticket.

[web2py] Re: How to email attachment with original filename

2012-08-17 Thread Cliff Kachinske
The problem is I didn't pay attention while looking this up in the manual. :) applies palm to forehead On Friday, August 17, 2012 9:53:51 AM UTC-4, Niphlod wrote: Attachments take an optional parameter to specify the filename, so what is your current problem ? You have the original name

[web2py] Source compile error - local vs. remote - frustrating

2012-08-17 Thread wdtatenh
My site is hosted on webfaction. The web2py src code is the same on local remote - both have the latest web2py src. Compiled my site locally, uploaded to my remote site and I get raise SystemError, 'compiled code is incompatible' SystemError: compiled code is incompatible The Webfaction

Re: [web2py] Source compile error - local vs. remote - frustrating

2012-08-17 Thread Jonathan Lundell
On 17 Aug 2012, at 7:41 AM, wdtatenh wdt...@comcast.net wrote: My site is hosted on webfaction. The web2py src code is the same on local remote - both have the latest web2py src. Compiled my site locally, uploaded to my remote site and I get raise SystemError, 'compiled code is

[web2py] Adding LinkedIn authentication as an option to existing username/password authentication

2012-08-17 Thread Carl
Big hat tip to: Udi Milo These steps will enable a Web2py app that currently authenticates users using username/password (or email.password) to add the option for users to use their LinkedIn account instead. Once logged in, the app can access the LinkedIn API to access user LinkedIn data. *1.

[web2py] Re: Electronic voting anybody?

2012-08-17 Thread villas
Yep, worked this time! On Friday, August 17, 2012 3:31:26 PM UTC+1, Massimo Di Pierro wrote: Sorry. I was editing the code live. Try now. On Friday, 17 August 2012 09:15:56 UTC-5, villas wrote: I like this idea, but when I tried it, this happened: I set up a ballot and received an

[web2py] computed fields are not executed with Table inheritance

2012-08-17 Thread Paolo
Hi all, I've just discovered that the fields defined as computed in the 'upper table' are not executed in the table that inherits the fields. The following is the definition of the upper table pictures_fields = db.Table(db, 'picture', Field(picture, upload,

Re: [web2py] Congratulations to Bruno and Mariano

2012-08-17 Thread R. Strusberg
Parabéns Bruno! - Felicitaciones Mariano! 2012/8/17 Massimo Di Pierro massimo.dipie...@gmail.com Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations. http://pyfound.blogspot.com.br/2012/08/welcome-new-psf-members.html -- --

[web2py] Re: How to find duplicate rows with Web2py DAL

2012-08-17 Thread Loreia
Thanks a lot. BR Loreia On Thursday, August 16, 2012 1:23:39 PM UTC+2, Niphlod wrote: group by your unique columns, count the rows, find the ones with count 1. db.define_table( 'finddup', Field('f1_name'), Field('f2_name'), Field('f3_name') ) fd = db.finddup count

[web2py] Select a table given its table name?

2012-08-17 Thread lyn2py
Hi, I want to achieve something like this: def feed(table): return db(db.table.id0).select() How should the code be written? Thanks! --

Re: [web2py] Select a table given its table name?

2012-08-17 Thread Bruno Rocha
def feed(table): return db(db[table].id0).select() --

Re: [web2py] Select a table given its table name?

2012-08-17 Thread lyn2py
Thank you Bruno! That was quick! On Friday, August 17, 2012 11:37:58 PM UTC+8, rochacbruno wrote: def feed(table): return db(db[table].id0).select() --

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread lyn2py
Congratulations, guys!! On Friday, August 17, 2012 10:13:45 PM UTC+8, Massimo Di Pierro wrote: Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations. http://pyfound.blogspot.com.br/2012/08/welcome-new-psf-members.html --

Re: [web2py] Source compile error - local vs. remote - frustrating

2012-08-17 Thread wdtatenh
Thanks - I'm installing python 2.7 on my machine and that should resolve the problem. --

Re: [web2py] Re: Back-and-forth between DAL SQLAlchemy

2012-08-17 Thread Larry Wapnitsky
OK. Im getting close, but Im stuck on the following SQLAlchemy code conversion: recipients = relationship( 'Recipient', secondary = mr_link, backref = 'message', lazy = 'dynamic' ) attachments =

Re: [web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Michele Comitini
+1! 2012/8/17 lyn2py lyn...@gmail.com: Congratulations, guys!! On Friday, August 17, 2012 10:13:45 PM UTC+8, Massimo Di Pierro wrote: Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations.

[web2py] web2py and python 2.7 - won't compile

2012-08-17 Thread wdtatenh
Installed python 2.7. Trying to start up web2py and I get the following traceback - note URLLIB and SOCKET are located in ...python27/Lib Appreciate help. No handlers could be found for logger web2py Traceback (most recent call last): File web2py.py, line 16, in module import

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

2012-08-17 Thread Michele Comitini
Indeed I wrote the patch to allow raising a meaningful error if the module is not loaded. The action taken should be the same as before the patch i.e.: return super(_Web2pyImporter, self).__call__(name, globals, locals, fromlist, level) but

[web2py] Re: Catch rows in Javascript

2012-08-17 Thread Anthony
How can I catch rows in Javascript code ? What does this mean? Can you give an example? --

[web2py] New Django REST library

2012-08-17 Thread pbreit
Worth taking a look at: https://github.com/freshplum/django-simple-rest --

[web2py] Re: Best way to insert 200k records?

2012-08-17 Thread nick name
On Friday, August 17, 2012 8:29:12 AM UTC-4, Mike Girard wrote: The data will be coming from a large XML file, so my script will parse that and make inserts into several different tables. It's fairly straightforward. So is it correct to say that - 1. There is no compelling reason to do

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

2012-08-17 Thread Anthony
IS_EXPR executes the expression in an environment that only contains the value being validated (but not any other globals defined in your model). For this to work, you would have to include all of the necessary code in the expression (i.e., the definition of badlist and BADWORDS). A better

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

2012-08-17 Thread Anthony
*Question:* Would it be worth considering an actual validator for username and user-like fields. *IS_LIKE_GOOGLE* IS_LIKE_GOOGLE validator enforces a username policy similar to Google Accounts (as of 2012), min 6 - 30 characters, only letters (a-z) and numbers (0-9), and periods,

Re: [web2py] Congratulations to Bruno and Mariano

2012-08-17 Thread Samuel Marks
Mazel tov! Samuel Marks On Sat, Aug 18, 2012 at 12:13 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations. http://pyfound.blogspot.com.br/2012/08/welcome-new-psf-members.html --

[web2py] define existing tables

2012-08-17 Thread Simon Carr
Hi, I am writing an app to connect to and run some functions against a PrestaShop Database on MySQL. There are a lot of fields and a lot of tables in the databases which would take quite some time to create define_table for all of them. Does anyone know of any automation script that exists

[web2py] Re: web2py does not start as windows service

2012-08-17 Thread mcamel
I've just join the group today searching for the answer to the same problem as you. I've read dozens of post and will try some of this: - at the en of this post https://groups.google.com/forum/?fromgroups#!searchin/web2py/service$20windows/web2py/j-NT5gsMasE/SQV3g-kHHp8J[1-25]is

Re: [web2py] Select a table given its table name?

2012-08-17 Thread apps in tables
How to get the list of the fields names? On Friday, August 17, 2012 6:37:58 PM UTC+3, rochacbruno wrote: def feed(table): return db(db[table].id0).select() --

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread apps in tables
besides congratulations, what do you eat ? maybe this is the reason for being smart. Ashraf On Friday, August 17, 2012 5:13:45 PM UTC+3, Massimo Di Pierro wrote: Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations.

Re: [web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Ovidio Marinho
deservedly a double Pythonistas Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Niphlod
or congratulating offering cookies ;-P On Friday, August 17, 2012 8:38:07 PM UTC+2, apps in tables wrote: besides congratulations, what do you eat ? maybe this is the reason for being smart. Ashraf --

[web2py] Re: How to find duplicate rows with Web2py DAL

2012-08-17 Thread Niphlod
np. BTW: no simple ways to do that. Just mind that if there are millions rows (especially if the columns are not indexed) that is going to take some time. On Friday, August 17, 2012 5:09:40 PM UTC+2, Loreia wrote: Thanks a lot. BR Loreia On Thursday, August 16, 2012 1:23:39 PM UTC+2,

[web2py] Re: How to email attachment with original filename

2012-08-17 Thread Niphlod
no problem. It's just that sometimes questions seems sketchy and I really don't understand what the issue really is. Fortunately manual (and source code) are handy :P On Friday, August 17, 2012 4:36:23 PM UTC+2, Cliff Kachinske wrote: The problem is I didn't pay attention while looking this

Re: [web2py] Select a table given its table name?

2012-08-17 Thread Anthony
db.mytable.fields returns a list of the field names, and db.mytable.fields() returns a copy of that list (so if you mutate the copy, the original list doesn't change). Anthony On Friday, August 17, 2012 2:27:22 PM UTC-4, apps in tables wrote: How to get the list of the fields names? On

[web2py] Re: Best way to insert 200k records?

2012-08-17 Thread Mike Girard
10 minutes is all right. Still, if there are two methods and they are qualitatively equal apart from speed, I'd prefer to use the faster one. So posing the question, once again, is there a compelling reason to use the DAL for bulk uploads. More specficially, what extras, if any, are being

Re: [web2py] Re: Back-and-forth between DAL SQLAlchemy

2012-08-17 Thread Massimo Di Pierro
It depends on context. Web2py DAL is closer to SQL than on ORM. Assuming db.define_table('person',Field('name'),Field('email')) you have two options: 1) db.define_table('message',Field('body'),Field('recipients','list:reference person')) for row in db(db.message).select(): # one select

[web2py] id field? when using SQLForm.grid

2012-08-17 Thread Simon Carr
Do I need an ID field in my database when using the SQLForm.grid I am reading data from a legacy MySQL database which does not have an id field. Many thanks Simon --

Re: [web2py] Re: How to find duplicate rows with Web2py DAL

2012-08-17 Thread Loreia
Don't worry this table is modest in size. Any solution is good enough for me, as long as it gets the job done :-)) Thanks and BR Loreia On Fri, Aug 17, 2012 at 9:06 PM, Niphlod niph...@gmail.com wrote: np. BTW: no simple ways to do that. Just mind that if there are millions rows (especially

[web2py] Re: New Django REST library

2012-08-17 Thread Massimo Di Pierro
looks familiar On Friday, 17 August 2012 11:57:50 UTC-5, pbreit wrote: Worth taking a look at: https://github.com/freshplum/django-simple-rest --

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Massimo Di Pierro
I think you have a point. Bruno is Vegan. Mariano eats excellent quality Argentinian meat. We in US on the other side eat processed food mixed with hydrogenated fats and corn syrup. No good. On Friday, 17 August 2012 13:38:07 UTC-5, apps in tables wrote: besides congratulations, what do you

Re: [web2py] Re: Back-and-forth between DAL SQLAlchemy

2012-08-17 Thread Larry G. Wapnitsky
mind if I post my SQLAlchemy code on Monday? I'm still a bit off with what I'm trying to accomplish in web2py. Thanks On 8/17/2012 3:41 PM, Massimo Di Pierro wrote: It depends on context. Web2py DAL is closer to SQL than on ORM. Assuming db.define_table('person',Field('name'),Field('email'))

[web2py] Re: define existing tables

2012-08-17 Thread villas
Take a look at web2py/scripts/extract_mysql_models.py --

Re: [web2py] id field? when using SQLForm.grid

2012-08-17 Thread Simon Carr
Hi, I found the answer to this question, so if anyone else is looking for an answer to this question, here is the solution. in your model you need to just add 'id' to the to your primary field here is an example. db.define_table( 'product', Field('id_product','id'), your other fields as usual

Re: [web2py] Re: Back-and-forth between DAL SQLAlchemy

2012-08-17 Thread Larry G. Wapnitsky
also, do you think I might be better off doing this in MongoDB rather than MySQL/SQLAlchemy? On 8/17/2012 3:41 PM, Massimo Di Pierro wrote: It depends on context. Web2py DAL is closer to SQL than on ORM. Assuming db.define_table('person',Field('name'),Field('email')) you have two options:

[web2py] Re: web2py does not start as windows service

2012-08-17 Thread villas
Below is an excerpt from the book -- please note that you should also look at the -L option: if you run web2py as Windows Service, -W, it is not convenient to pass the configuration using command line arguments. For this reason, in the web2py folder there is a sample options_std.py

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

2012-08-17 Thread curiouslearn
Thanks pbreit and weheh. I looked at the link give by pbreit. It says the following: applications requiring site-packages are not portable unless these modules are installed separately. What exactly does it mean they are not portable? For example, as of now my application which lives in a

Re: [web2py] id field? when using SQLForm.grid

2012-08-17 Thread Omi Chiba
Actually I have issue #547 for this. http://code.google.com/p/web2py/issues/detail?id=547 On Friday, August 17, 2012 3:22:53 PM UTC-5, Simon Carr wrote: Hi, I found the answer to this question, so if anyone else is looking for an answer to this question, here is the solution. in your

Re: [web2py] Re: Back-and-forth between DAL SQLAlchemy

2012-08-17 Thread Massimo Di Pierro
Not sure what you asking. You are welcome to post sqlachemy code. On Friday, 17 August 2012 15:31:30 UTC-5, Larry Wapnitsky wrote: also, do you think I might be better off doing this in MongoDB rather than MySQL/SQLAlchemy? On 8/17/2012 3:41 PM, Massimo Di Pierro wrote: It depends on

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Cliff Kachinske
Great. Many thanks to both. On Friday, August 17, 2012 10:13:45 AM UTC-4, Massimo Di Pierro wrote: Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations. http://pyfound.blogspot.com.br/2012/08/welcome-new-psf-members.html --

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Cliff Kachinske
Massimo, you forget the salt. NaCl, without which there would be no USA cuisine. On Friday, August 17, 2012 3:54:38 PM UTC-4, Massimo Di Pierro wrote: I think you have a point. Bruno is Vegan. Mariano eats excellent quality Argentinian meat. We in US on the other side eat processed food

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

2012-08-17 Thread villas
I guess it is referring to the packing/installation of *.w2p files via the admin interface. Only files under the app's dir would be packed, therefore site-packages would have to be installed outside that mechanism. By using Dropbox you are not relying on the admin interface for the

[web2py] Re: Best way to insert 200k records?

2012-08-17 Thread howesc
if it is a one time data load and i have the proper constraints set in SQLLite, i would use raw SQL. if this was repetitive use and i wanted to use web2py validation i would use the DAL with bulk insert (making sure that i validate the data before adding to the insert queue) On Friday, August

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

2012-08-17 Thread Cliff Kachinske
curiouslearn I agree it's a good idea to learn as much as you can about the underlying database. That said, you need to learn about sql injection and perhaps other MySQL attack vectors before making your application public. See, for example xkcd.com/327/ On Friday, August 17, 2012 12:17:48

[web2py] Re: IS_IN_DB cannot pull the data from the table

2012-08-17 Thread villas
Specify the field that you wish to appear in the dropdown box Try what the book says, 'name' is simply the name of the field you wish to appear: db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s', zero=T('choose one')) --

[web2py] Re: IS_IN_DB cannot pull the data from the table

2012-08-17 Thread Anthony
But he's not getting any records at all in the list. On Friday, August 17, 2012 5:20:42 PM UTC-4, villas wrote: Specify the field that you wish to appear in the dropdown box Try what the book says, 'name' is simply the name of the field you wish to appear: db.dog.owner.requires =

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

2012-08-17 Thread howesc
response.include_file() outputs the files that were added to response.files (js, css). when you remove that you loose the auto output of files that were added to response.files along the way. response.include_mete() works much the same for HTML meta properties. can we see the resulting HTML

[web2py] mail.send transposing to and subject ; can anybody explain this?

2012-08-17 Thread Cliff Kachinske
The simple controller says this: record = get_email_record() approved_suppliers = get_approved_suppliers(record.products.id) mail.settings.server = 'logging' mail.settings.sender = 'foobar@gmail.com' mail.settings.login = False mail.send( to

[web2py] Re: IS_IN_DB cannot pull the data from the table

2012-08-17 Thread Omi Chiba
Just in case, I changed just like you suggested but I got a same result. I can pull the data from other tables on the same database but I cannot pull the data from this one I should be dreaming or getting crazy... : ( I first doubt a simple typo but I can't figure out.

Re: [web2py] Select a table given its table name?

2012-08-17 Thread apps in tables
Thank you, Anthony. On Friday, August 17, 2012 10:37:02 PM UTC+3, Anthony wrote: db.mytable.fields is a list of the field names, and db.mytable.fields() returns a copy of that list (so if you mutate the copy, the original list doesn't change). Anthony On Friday, August 17, 2012

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Mike Girard
Congratulations, guys. I appreciate all the work you do. On Friday, August 17, 2012 10:13:45 AM UTC-4, Massimo Di Pierro wrote: Congratulations to Bruno Rocha and Mariano Reingart, New members of the Python Software Foundations.

[web2py] Get row count for query without loading data into memory

2012-08-17 Thread Mike Girard
Does this load the rows into memory? db(db.person.id 0).count() If so, is there a DAL way to get a row count for a query without loading the rows? Thanks. Mike --

Re: [web2py] Get row count for query without loading data into memory

2012-08-17 Thread Bruno Rocha
It returns no Row. It return an int object db(db.person.id 0).count() *Translates to SELECT count(*) FROM PERSON WHERE ID )* *So the result is an integer object.* *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br |

Re: [web2py] id field? when using SQLForm.grid

2012-08-17 Thread Simon Carr
I have tested with the solution I posted and it works fine. Does it work for you? Simon On 17 August 2012 21:41, Omi Chiba ochib...@gmail.com wrote: Actually I have issue #547 for this. http://code.google.com/p/web2py/issues/detail?id=547 On Friday, August 17, 2012 3:22:53 PM UTC-5, Simon

[web2py] Re: Get row count for query without loading data into memory

2012-08-17 Thread Cliff Kachinske
I'm not really a DAL guru, but I can't imagine DAL doing that. Every dbms I know about has something like SELECT COUNT(id) WHERE ...query On Friday, August 17, 2012 5:54:32 PM UTC-4, Mike Girard wrote: Does this load the rows into memory? db(db.person.id 0).count() If so, is there a

Re: [web2py] Select a table given its table name?

2012-08-17 Thread Bruno Rocha
Also, you would get exceptions if table does not exists, so: def feed(table): *try*: return db(db[table].id0).select() *except* KeyError: return Sorry, table not found *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821

Re: [web2py] Select a table given its table name?

2012-08-17 Thread apps in tables
Thank you, Bruno. your code is different after getting the membership :) Congratulations Ashraf On Saturday, August 18, 2012 1:01:29 AM UTC+3, rochacbruno wrote: Also, you would get exceptions if table does not exists, so: def feed(table): *try*: return

[web2py] Re: Get row count for query without loading data into memory

2012-08-17 Thread Mike Girard
Wow. You guys are so fast. After posting, I found out about the Toolbar and looked at the SQL myself. I feel stupid for asking. What threw me off was some code I saw of Massimo's where he used raw SQL to get a record count. I found myself wondering why. On Friday, August 17, 2012 6:00:20

[web2py] Re: mail.send transposing to and subject ; can anybody explain this?

2012-08-17 Thread Niphlod
It was a bug (just a display type, mails are sent correctly, it is only the print to the logging that is misplaced), that is fixed in recent versions. On Friday, August 17, 2012 11:25:44 PM UTC+2, Cliff Kachinske wrote: The simple controller says this: record = get_email_record()

[web2py] How to use mysql on GAE?

2012-08-17 Thread Pystar
I know that GAE supports mysql, ??? How do I use that instead of bigtable? --

[web2py] Re: mail.send transposing to and subject ; can anybody explain this?

2012-08-17 Thread Cliff Kachinske
Many thanks. It was mighty strange, since I've used mail.send() before without problem. On Friday, August 17, 2012 7:01:55 PM UTC-4, Niphlod wrote: It was a bug (just a display type, mails are sent correctly, it is only the print to the logging that is misplaced), that is fixed in recent

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

2012-08-17 Thread Massimo Di Pierro
What kind of thread problems did you have on GAE? On Friday, 17 August 2012 16:23:17 UTC-5, howesc wrote: response.include_file() outputs the files that were added to response.files (js, css). when you remove that you loose the auto output of files that were added to response.files along

[web2py] Re: IS_IN_DB cannot pull the data from the table

2012-08-17 Thread Massimo Di Pierro
Please open a ticket pointing to this thread. Will look at it asap. On Friday, 17 August 2012 17:33:51 UTC-5, Omi Chiba wrote: I finally figured this should be a bug on the current in trunk version (Version 2.0.0 (2012-08-15 17:30:38) dev) I can pull the data when the data in primarykey

[web2py] Major speed improvement need testers

2012-08-17 Thread Massimo Di Pierro
There are two major speed improvements in trunk and I am not sure whether they should go in web2py 2.0 next week. 1) Lazy table (based on ideas from Bruno). db = DAL(, lazy_tables=True) db.define_table('person',Field('name')) the table is instantiated only when db.person is accessed. So

  1   2   >