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.
--
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
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
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.
--
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
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
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
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
Hi,
How can I catch rows in Javascript code ?
Thanks
Mathias
--
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
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.
--
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
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.
--
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
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
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()
--
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
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
--
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
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
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
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
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
--
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.
--
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
--
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
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
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
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.
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
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
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
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.
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
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,
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
--
--
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
Hi,
I want to achieve something like this:
def feed(table):
return db(db.table.id0).select()
How should the code be written?
Thanks!
--
def feed(table):
return db(db[table].id0).select()
--
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()
--
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
--
Thanks - I'm installing python 2.7 on my machine and that should resolve
the problem.
--
OK. Im getting close, but Im stuck on the following SQLAlchemy code
conversion:
recipients = relationship( 'Recipient',
secondary = mr_link,
backref = 'message',
lazy = 'dynamic' )
attachments =
+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.
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
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
How can I catch rows in Javascript code ?
What does this mean? Can you give an example?
--
Worth taking a look at:
https://github.com/freshplum/django-simple-rest
--
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
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
*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,
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
--
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
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
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()
--
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.
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
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
--
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,
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
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
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
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
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
--
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
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
--
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
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'))
Take a look at web2py/scripts/extract_mysql_models.py
--
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
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:
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
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
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
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
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
--
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
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
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
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
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'))
--
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 =
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
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
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.
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
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.
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
--
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 |
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
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
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
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
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
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()
I know that GAE supports mysql, ??? How do I use that instead of bigtable?
--
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
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
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
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 - 100 of 106 matches
Mail list logo