Ah yes! Thank you, Greg!
I come from the Matlab world and am not very experienced with object
oriented program, but I was suspecting it was something like that.
I think I found a true bug in the way datetime objects work in db queries,
though -- I will post under a new subject heading.
(SOLVED)
Simply had to put migrate=False,fake_migrate=True into the table.
See: http://www.web2py.com/book/default/chapter/06#Migrations
On Aug 19, 3:38 pm, Jarrod Cugley jcug...@gmail.com wrote:
I think I broke it by accidentally creating an infinite loop... Hehe.
The error is this:
Doing database queries on datetime.datetime fields seems broken. Here's an
example:
I have a database with a table 'transEntry' which includes a 'datetime'
field:
db.define_table('itemEntry',
* Field('dateTime','datetime'),*
Field('upc', 'string'),
Field('description',
What is the best way to create a user profile page, is it to just
extend the auth table and then hide the extra fields during sign up
using jquery. Then expose them again when allowing the user edit/
create their profile? I am used to the django way of declaring the
auth module in the settings.py
In [183]: broken_search = db( (db.transEntry.dateTime ex)
(db.transEntry.storeNumber==store_num)
(db.transEntry.terminalNumber==lane_num) ).select(
orderby=db.transEntry.dateTime)
In [184]: len(gar2)
Out[184]: 270
In your exmaple above, in [183] you're assigning to variable
Cut and paste, sorry!
Wanted to rename broken_search for clarity and failed. Late night...
—« sent from my Droid tablet »—
On Aug 19, 2011 12:12 AM, Jose C houdinihoun...@gmail.com wrote:
In [183]: broken_search = db( (db.transEntry.dateTime ex)
(db.transEntry.storeNumber==store_num)
worked perfectly!
Thanks for the info (and obviously for letting us use your app!)
much appreciated,
Mart :)
On Aug 19, 1:39 am, Julio Schwarzbeck ju...@techfuel.net wrote:
Both questions are addressed in the forums, I appreciate the feedback!
To hide them without creating custom forms, set readable = writable = False
in the controller.
Can you try set
export WEB2PY_PATH=/path/to/web2py
On Aug 18, 8:01 pm, TheSweetlink yanosh...@gmail.com wrote:
Yes sir I did that.
celeryd --loglevel=DEBUG -E
runs just fine but
celerybeat -S scheduler.Web2pyScheduler --loglevel=DEBUG
does not for me. Error posted above.
On Aug 18,
Hmm, nothing stands out as wrong in the logic to me.
Could `store_num` or `lane_num` have changed between runs?
Is it a shared db, i.e. is it possible someone else is accessing the
database (adding/removing records) while you're testing?
You have some other inconsistencies in the output above.
Now you can also do this (complete program):
# model
db=DAL()
from gluon.tools import Auth
auth=Auth(db)
auth.define_tables()
db.define_table('person',Field('name'))
db.define_table('dog',Field('name'),Field('image','upload'),Field('owner',db.person))
if db(db.person).isempty():
from
Hello,
I am following the restful APIs video on vimeo (http://vimeo.com/
21133657)
Now I am trying to test the manage_dog POST with curl:
curl -i -H Accept: application/json -X POST -d info=aNewInfo,
owner=55, name=aNewName http://localhost:8000/restful/api/manage_dog/
However, this gives a bad
On Aug 19, 12:52 am, pbreit pbreitenb...@gmail.com wrote:
To hide them without creating custom forms, set readable = writable = False
in the controller.
Thanks, will that be in the def user(): controller.
The web2py is advancing so fast, that the documentation get deprecated
before get published. :)
2011/8/18 Massimo Di Pierro massimo.dipie...@gmail.com
Actually I just killed myself in the foot... I am writing a packt book
with some other members of the list. Have to deliver it in 5 days.
Can you try append a .json to the URLs or have you done so already?
On Aug 19, 4:08 am, Christian hff...@googlemail.com wrote:
Hello,
I am following the restful APIs video on vimeo (http://vimeo.com/
21133657)
Now I am trying to test the manage_dog POST with curl:
curl -i -H Accept:
Some more info. For the example below
http://domain.com/app/default/index/table # all
records for table
http://domain.com/app/default/index/table?keywords=... # all records
for table that match search
http://domain.com/app/default/index/table.field/value # all
Thank you, that worked. don't know, why I did that in DELETE but not
in post.
Anyway, thank you!!!
On Aug 19, 11:58 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
Can you try append a .json to the URLs or have you done so already?
On Aug 19, 4:08 am, Christian hff...@googlemail.com
using the web2py repository, is this how you get trunk:
hg clone https://code.google.com/p/web2py/
What are the commands to update the local copy to the latest trunk or
the latest stable?
Thanks.
'hg pull' and then 'hg update'
Thats very good
Thank you so much Massimo! i will test it out and let you know!
On Thu, Aug 4, 2011 at 3:25 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
In trunk, I added
scripts/make_min_web2py.py
run it with
cd web2py
python scripts/make_min_web2py.py ../minweb2py
cd ..
Thanks, Bruno.
On Aug 18, 9:55 pm, Bruno Rocha rochacbr...@gmail.com wrote:
CORRECTIONl:
for field in db.mytable.fields:
* field = db.mytable[field]*
if field.type == 'double':
field.represent = lambda value: %.2f % value
Dear fellow w2peers, I would like to make use of the db validators
through an sqlform, but without having user interaction. Code speaks
best:
logs = [ ]
for line in file('my_input_file.txt').readlines():
name,age = line.split(',')
form = SQLFORM(db.person)
request.vars.name = name
Actually, you don't need to use SQLFORM at all to take advantage of
validation. Instead, you can do:
db.table.validate_and_insert(...) # to insert new record
or
db(query).validate_and_update(...) # to update an existing record
(Note, the above is not in the book yet.)
Also, if you
Thanks heaps Anthony. I'll give it a bash.
I had a look at the source for validate_and_update/insert and it
appears that it doesn't take the onvalidation parameter that SQLFORM
does. I guess I can apply the onvalidation method on its own and then
look for form.errors.
The form.accepts without a
Are all the results (2012, 12, 10) and earlier? Maybe it's only comparing
the dates and not the times for some reason (don't know why). In that case,
since you're using strict (rather than =), it would make sense that no
results would be later than (2012, 12, 10).
Anthony
On Friday, August
On Friday, August 19, 2011 5:30:06 AM UTC-4, Anaconda wrote:
On Aug 19, 12:52 am, pbreit pbreit...@gmail.com wrote:
To hide them without creating custom forms, set readable = writable =
False
in the controller.
Thanks, will that be in the def user(): controller.
Sure. You could set
Hi all,
Can I propose the following in order to being able to subclass DAL classes?.
We can currently subclass DAL in our own models and use the new class at DAL
creation time (db = MyDAL(...)), but the problem is that all other classes
are internally and directly instantiated in DAL.py.
So
I'm sure this is a very fundamental Win2py or Python thing. I'm such
a Noob.
I am writing a database populator program that I would like to run
outside the framework
to fill the database with test data.
I have been struggling with importing the models from the
application. Here's what I've
HOT!
Richard
On Fri, Aug 19, 2011 at 6:29 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
Some more info. For the example below
http://domain.com/app/default/index/table # all
records for table
http://domain.com/app/default/index/table?keywords=... # all
;-D
Think we will be needing a recent advance briefing email througth the
list...
Richard
On Fri, Aug 19, 2011 at 5:57 AM, Martín Mulone mulone.mar...@gmail.comwrote:
The web2py is advancing so fast, that the documentation get deprecated
before get published. :)
2011/8/18 Massimo Di
On Aug 16, 2011, at 3:07 PM, vapirix wrote:
So I'm attempting to set up the usage scenario of:
domain1.com - load app 1
domain2.com - load app 2
etc. etc.
I need domain1 to NOT have access to app 2, 3, 4, 5, etc.
That all works using the router's domain settings. Obviously you run
Apologies again - all typos. The first query was built by typing (no longer
in my ipython history), and full of mistakes.
The proper way to do this is to create a simple sample that everyone can
replicate (too tired late last night to do so..).
Will do so now, constrained by work
I think you are right, Anthony!
In the original query, first_search (or gar with), first_search[270] is the
first entry on the new date!!!
(and also first_search[269] is the same entry as broken_query[269], so the
search results are the same up to that point).
I will still make a simple
I found a free web2py hosting service: alwaysdata.com
They only provide 10MB free but if you remove applications/examples
and gluon/contrib/populate.py and gluon/contrib/py*/* web2py fits in
there.
Problem. They support fcgi but I cannot figure it out. Instructions
are scarse and in french.
Can
I actually changed the URLs (again). Give it a try to see what they
are.
On Aug 19, 5:29 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
Some more info. For the example below
http://domain.com/app/default/index/table # all
records for
use google translate :P
On Fri, Aug 19, 2011 at 12:13 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
I found a free web2py hosting service: alwaysdata.com
They only provide 10MB free but if you remove applications/examples
and gluon/contrib/populate.py and gluon/contrib/py*/*
This means one dict lookup for every instance. This will results in an
lots of work and possible overhead.
I would like to see a case about why this is necessary.
I am still not convinced there is any need to subclass dal. I have
been wrong before.
massimo
On Aug 19, 9:43 am, Carlos
Let me add I am worried about concurrency issues with this approach.
Where would subclassing be done? Cannot be done in models.
On Aug 19, 9:43 am, Carlos carlosgali...@gmail.com wrote:
Hi all,
Can I propose the following in order to being able to subclass DAL classes?.
We can currently
Can help translate... What the exact page? Or I should open a account?
Richard
On Fri, Aug 19, 2011 at 1:13 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
I found a free web2py hosting service: alwaysdata.com
They only provide 10MB free but if you remove applications/examples
and
Hi All,
I'm starting a new project in GAE and I'm considering web2py for it. I
haven't used GAE for a long time (and consequently web2py+GAE).. but the
last time that I've used it provided some extra functionalities to
compensate the nosql limitations. For example it provided some kind of in
some thoughts.
- belongs can only have 30 items in it per execution. GAE limitation
- i do many-to-many on GAE by using join tables, i just have to do more
queries. it does mean that you can't return 100 courses plus all the
students in the course in a single query (if say each course
Check, did that too as it comes before the line that gives me an error
in ABOUT's instructions.
Following ABOUT went swimmingly up until running celerybeat.
rabbitmq-server broker ready, celeryd is ready, but I can't seem to
run that celerybeat command.
On Aug 19, 4:07 am, Massimo Di Pierro
Here is a simple example ... but it seems to behave properly:
test datetime in db queries
import sys
sys.path.append(/mnt/data1/web2py)
from gluon import *
import datetime
import random
db = DAL('sqlite://debug_datetime.sqlite',
That's good to know, thanks - so for more than 30 items, something
like this
people = db(db.person.id.belongs(course.students)).select()
isn't possible?
Would it be possible for you to give me an example of using join
tables?
(I think my brain is still in SQL mode and I can't work out how I'd
hg update by itself brings your working directory up the most recent
changeset available in your local repository (depending on when you did hg
pull).
You can also specify a changeset ID or tag with hg update in order to set
your working directory to a specific version.
Example:
hg update
Their support group, available in forums, is helpful and speaks English.
Hi Massimo, I deploy an application by following the documentation
this way:
1 - send web2py for the root, and create a diretory caled /public in
the root too
2 - create a file called web2py.fcgi, in /public dir, with this
content
#!/usr/bin/python
import os, sys
_PROJECT_DIR =
Hi Massimo,
If dict access is overhead, we can use direct variable assignments (as
mentioned in my second approach), e.g. db.cls_table (and db.cls_rows,
db.cls_row, ...).
The why: I need to do lots of processing with these DAL objects (DAL, Table,
Field, Set, Rows, Reference, Row, etc.) and
Upon further investigation I looked at validators.py to make sure I
was passing IS_IN_SET() the data it is looking for.
A list of tuples should be no problem. I suspect it must be either
the '#' or the ':' that's the problem.
1) Am I correct in assuming that it shouldn't matter if everything in
Please excuse my typo. I passed one dict as the validator expects
rather than a list of dicts.
I also tried passing a list of dicts to IS_IN_SET() and get the same
LazyT 'value not allowed' error.
Hi all,
there is a lot of useful information in this forum. However, it is
scattered over many posts and often one can't get the essence without
reading through the thread.
Should there be a web2py wiki? I think it would be very useful to have
a centralized and editable repository for web2py
http://twitter.github.com/bootstrap/
Spammers are getting more clever. Today I found a message that
contains valid python code but was spam. How do I know? Because 99% of
the spam we receive contain links to the same web site. This one did
too, in the signature.
When approving emails, please check the links they contain.
Massimo
Perhaps not the problem but this:
sys.path.append(/mnt/data1/web2py)
is not thread safe. It will be executed at every request and in the
best of cases you will get a memory leak.
On Aug 19, 12:51 pm, Luis Goncalves lgoncal...@gmail.com wrote:
Here is a simple example ... but it seems to behave
Hello all,
Ofcourse a lot of math and statistics can be done by Python. Adding R to
Python as a module through Rpy2 may make this complete. Is there any
experience using Rpy2 within Web2py?
Regards,
Richard
Are you aware of www.web2pyslices.com? I think Bruno and Martin are working
on a new version as well.
Anthony
On Friday, August 19, 2011 2:59:32 PM UTC-4, czamb wrote:
Hi all,
there is a lot of useful information in this forum. However, it is
scattered over many posts and often one
You'll probably get more responses if you start a new thread (with new
subject) for a completely new topic.
On Friday, August 19, 2011 3:09:58 PM UTC-4, Richard wrote:
Hello all,
Ofcourse a lot of math and statistics can be done by Python. Adding R to
Python as a module through Rpy2 may
Hello all,
Of course a lot of math and statistics can be done by Python. Adding R
to
Python as a module through Rpy2 may make this complete. Is there any
experience using Rpy2 within Web2py?
Regards,
Richard
Ciao Massimo,
I wasn't clear in my post : It's not a web app, I'm using DAL as part of a
data analysis program I am writing. I debug with ipython, but the
script/programs I write can be called like : python
test_412_determine_open_or_closed_lane.py , which outputs results to a
file.
request.now is in local time, is that on purpose?
I think a request.utcnow would also be useful (now can be derived from
utcnow, but the other way around is not 1:1 on days when daylight saving
time changes)
Thank you Relsi,
This was very useful. So made a minimalist web2py that works great.
Here are step by step instruction (my scripts are based on yours):
1) Register with
http://www.alwaysdata.com/
and get a free account (10MB) Let's say your domain is test1. Then you
have an account test1, a
nice
+1
2011/8/19 Vasile Ermicioi elff...@gmail.com:
nice
On Aug 16, 2011, at 3:07 PM, vapirix wrote:
So I'm attempting to set up the usage scenario of:
domain1.com - load app 1
domain2.com - load app 2
etc. etc.
I need domain1 to NOT have access to app 2, 3, 4, 5, etc.
That all works using the router's domain settings. Obviously you run
I have multiple fields in a record that I want to be always generated on
insert, never modified on update. Typical use case is a record creation
timestamp; a default of request.now is perfect, I don't want anyone to ever
override it, and I do want to get an error if accidentally trying to
You asked for it so here they are: built-in lazy virtual fields.
Q. How do they work?
A. Like normal virtual fields but no need to mess up with lambdas,
etc. Just add a @staticmethod decorator. Here is an example:
db=DAL()
db.define_table('x',Field('number','integer'))
if db(db.x).isempty():
Notice that Virtualfields do not need any knowledge of the db object.
You can declare the class in a module (not model).
Import the module and then apply them to the tables that need them.
On Aug 19, 6:03 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
You asked for it so here they are:
so, if I only do 'hg pull' i get trunk? and if I do 'hg update' I get
stable?
Is that what you mean?
On Aug 19, 7:20 pm, David Marko dma...@tiscali.cz wrote:
'hg pull' and then 'hg update'
so, if I only do 'hg pull' i get trunk? and if I do 'hg update' I get
stable?
Is that what you mean?
On Aug 19, 7:20 pm, David Marko dma...@tiscali.cz wrote:
'hg pull' and then 'hg update'
PS
The reason I'm asking this is so that I could try out the trunk
features without having to download the zipped files.
So I'm trying to find out how to
a.) get trunk version installed in a different directory using
mercurial
b.) get stable version installed in another directory using mercurial
Very good! Thank you
The caveat is teh fact that it is designed for modern browsers only, even in
Chrome the fonts seems to be strange.
I prefer to continue using the pack: 960.gs, HTML5 Boilerplate, CSS3Buttons,
EasyFramework + Wijmo.
I am also thinking about it, for usage in Scheduller when the system is
multilangual and the schedulle needs to be triggered in different time
zones.
On Fri, Aug 19, 2011 at 6:11 PM, nick name i.like.privacy@gmail.comwrote:
request.now is in local time, is that on purpose?
I think a
When you hg pull you grab all of the changes since you last did an hg
pull but your working directory remains unchanged. It is not until you do
an hg update that your working directory will reflect a new changeset (or
version, if you will). If you do hg update without specifying a tag or
Anthony, thank you for pointing me to web2pyslices, I just registered there.
I knew it before and it helped me out a couple of times. But it is not
exactly a wiki or? My point is that I see web2py and the web2py-users
gaining more momentum. Groups traffic increases and the rather unorganized
I have been working on another projects, but web2yslices2.0 is being
developed.
The delay was very good because now we can enjoy the new features of web2py.
I think in few weeks I will come with the new website!
(Wiki, Repository, Plugins, Pyforum...) All integrated.
:-)
On Aug 19, 7:54 pm, Bruno Rocha rochacbr...@gmail.com wrote:
I have been working on another projects, but web2yslices2.0 is being
developed.
The delay was very good because now we can enjoy the new features of web2py.
I think in few weeks I will come with the new website!
(Wiki,
I think I have figured it out, with the help of a python expert at work.
I am using sqlite3, which internally stores data as strings.
When creating my real database (not the toy example), I read raw date and
time data as an isoformat string, and relied on DAL/web2py to convert. But
perhaps in
Yes, I couldn't agree more. Let's see what web2pyslices2.0 looks like -- I'm
hoping it will do all this and more.
On Friday, August 19, 2011 8:53:53 PM UTC-4, czamb wrote:
Anthony, thank you for pointing me to web2pyslices, I just registered
there. I knew it before and it helped me out a
so, is there a tag for stable or trunk
On Aug 20, 8:51 am, pbreit pbreitenb...@gmail.com wrote:
When you hg pull you grab all of the changes since you last did an hg
pull but your working directory remains unchanged. It is not until you do
an hg update that your working directory will reflect
This thread might be relevant:
https://groups.google.com/d/topic/web2py/1N0TwMOgp3o/discussion
If you do use the PARSE_COLTYPES feature, datetimes work perfectly.
no, tags are used to tag version of Web2py.
If you take a look here you will see that we only have a default branch so
you do not need to specify it.
https://code.google.com/p/web2py/source/browse/
C.
Is there a way to have a required_not_to_be_specified setting for a
field?
You can change the writable and readable atributes, either in the model
or in controller.
Kenneth
83 matches
Mail list logo