What's inside now?
Inside now contains this -
import datetime; now = datetime.datetime.now() # For date time
Vinicius, I am sorry about the messed up traceback - Never noticed
that. simply copy-pasted the same. will take care in future (for now
its pasted below again)
But I don't understand why
Hello,
in our web2py based billing application we generate PDF:s that are sent
to customers. So far I have always saved the PDF onto my local computer
and attached that to a mail.
Now I'd like to develop the app so I could send the bill directly from
the app.
When the PDF is created it is
Oops, when I was testing it, I thought I could do this:
fields = (db.test.id,db.test.ref,db.test.descr)
db(db.test.id0).select(fields).as_list()
It seems that I have to do this:
db(db.test.id0).select(db.test.id,db.test.ref,db.test.descr).as_list()
Sorry for confusion!
remove response.headers['Content-**Type']='application/pdf'
f.render(filename, dest='F')
Ciao
2011/11/22 Kenneth Lundström kenneth.t.lundst...@gmail.com
Hello,
in our web2py based billing application we generate PDF:s that are sent to
customers. So far I have always saved the PDF onto my
#This uses 'links' to display my virtual field 'extradate'...
#Shows grid with all fields
grid=SQLFORM.grid(query=(db.prop.id 10), links=[dict(header='ExtraDate',
body=lambda row: row.extradate)] )
#This does the same thing but specifies fields...
grid=SQLFORM.grid(query=(db.prop.id 10),
Rahul,
some thoughts:
1) Your define_table() is executed at model time. When do you adjust
now contents?
2) I had this problem some time ago. The situation was I had created
my date field after some data was inserted in my table. So, this error
happened when I tried to retrieve some old data. I
Thank You. Works great now.
Kenneth
remove response.headers['Content-Type']='application/pdf'
f.render(filename, dest='F')
Ciao
2011/11/22 Kenneth Lundström kenneth.t.lundst...@gmail.com
mailto:kenneth.t.lundst...@gmail.com
Hello,
in our web2py based billing application we
Tried again. The link to www.box.com is definitely returning 404. If
you see content there, related to web2py, could you help me retrieve
it?
Thanks,
Ed
On Nov 20, 11:04 pm, Vineet vineet.deod...@gmail.com wrote:
I can access that link.
You may try to hit the link again.
--- Vineet
On Nov
On 22/11/2011 11:58, villas wrote:
fields = (db.test.id,db.test.ref,db.test.descr)
db(db.test.id0).select(fields).as_list()
It seems that I have to do this:
db(db.test.id0).select(db.test.id,db.test.ref,db.test.descr).as_list()
or if you prefer:
fields = [db.test.id, db.test.ref,
very useful information - thanks Robert.
I got compile errors for nginx - tried multiple versions and only 0.9.6.5
built, which doesn't support --http-socket.
I am on web9 which I understand is one of the older servers:
http://community.webfaction.com/questions/3042/uwsgi-installation
Which
Il giorno 22/nov/2011, alle ore 14:19, Plumo ha scritto:
very useful information - thanks Robert.
I got compile errors for nginx - tried multiple versions and only 0.9.6.5
built, which doesn't support --http-socket.
I am on web9 which I understand is one of the older servers:
I'm interested to learn the answer to this -I tried to export from
SQLite and import into a MySQL database, but the references got messed
up no matter what I tried...
On Nov 22, 4:36 am, David Manns dgma...@gmail.com wrote:
In my application which is hosted on GAE I have backup/restore
Hi,
I'm trying to format numbers according to the dutch standard (decimal
comma separator).
It is working on view/edit views by adding:
requires=IS_DECIMAL_IN_RANGE(0,100,dot=',') to the numeric field.
But in list views the numbers are displayed with a decimal dot.
How can I change that?
Hi All,
I am working with the python package SocketTornadIO and
socketio for realtime polling on web2py. The issue I am facing is
that if there is an established connection and some process is on
(eg.read a file and send the data to client) ; I cannot establish a
connection till the first
Massimo, the issue is that the grid doesn't provide an easy way to include
virtual fields. You can do it by using the 'links' argument with a
dictionary for each virtual field (though that's a bit cumbersome), but
then you cannot use the 'fields' argument to select only a subset of fields
or
Hello,
In our project we need to create a temporary user for the web2py app
so that a remote system can send back a singe status update. In order
to do this, when the command is sent out we create a temporary user
like this:
settings[serverUser] = str(uuid.uuid4())
Can you provide an example? Wat do you mean in list view?
On Nov 22, 6:41 am, Freerk Kalsbeek fre...@mindswitch.net wrote:
Hi,
I'm trying to format numbers according to the dutch standard (decimal
comma separator).
It is working on view/edit views by adding:
must be hashed
settings[serverPassword] =
db.auth_user.password.validate(str(uuid.uuid4()))[0]
On Nov 22, 8:19 am, Matt Broadstone mbroa...@gmail.com wrote:
Hello,
In our project we need to create a temporary user for the web2py app
so that a remote system can send back a singe status update.
On Tuesday, November 22, 2011 12:30:42 AM UTC-5, Adrian Edwards wrote:
form = SQLFORM(db.entries)
form.date_entered = date.today()
form.user = user
if form.process().accepted:
But the form won't submit. When I debug it through Eclipse it says
lazyT: value not in database
I
form.vars.updated_on= now
what's now?
form.vars.posted_by = Rahul
posted_by must be an id.
On Nov 22, 3:21 am, Rahul rahul.dhak...@gmail.com wrote:
What's inside now?
Inside now contains this -
import datetime; now = datetime.datetime.now() # For date time
Vinicius, I am
http://www.re-cycledair.com/creating-jquery-plugins
Thanks Manuele, that's the shortcut I should have been using. D
I am using the following decorator:
@cache(request.env.path_info, time_expire=5, cache_model=cache.ram)
To cache some db queries, however, when I go to deploy this on Google
App Engine, I receive a PicklingError: Can't pickle type
'function': attribute lookup __builtin__.function failed You can
How about:
return response.render(dict(pledges=pledges))
An alternative is just to cache the select instead of the whole view:
pledges=db((db.pledge.segment==segment_id)
(db.pledge.read == False)).select(orderby=~db.pledge.created_on,
cache=(cache.ram, 5))
In that case, you would
Hi guys,
my customer wants all data typed in forms, be stored in uppercase letters.
What's the best way to achieve it, with little effort?
--
Vinicius Assef.
signature from book:
IS_IN_DB(db, 'person.id', '%(name)s', zero=T('choose one'))
can also be:
IS_IN_DB(db(query), 'person.id', '%(name)s', zero=T('choose one'))
You have:
IS_IN_DB(db(db.categories.parent_table==request.args(0)),'categories.id','c
ategories.name')
Should be:
I just tried, no problem. Are you behind a proxy?
In my auth_group data I have defined a 'manager' role. The problem is that
when I try to deploy my app, the db does not get transferred, so my code
breaks because the 'manager' group cannot be found.
Is there a way to have it initialized when the app installs in a new
location?
Thank you
Thanks for the feedback. I have been making progress but not quit
there.
Massimo - I did find some logic problems with my initial select that
were contributing to the problem.
Anthony - I do think that how the form is being populated is part of
the problem
I've been trying to build this
I suppose you could use the IS_UPPER() validator on all the fields -- that
will convert all input to upper case for storage in DB. You could also use
JS/jQuery on the client side to convert as the user types.
Anthony
On Tuesday, November 22, 2011 10:48:10 AM UTC-5, viniciusban wrote:
Hi
On Tuesday, November 22, 2011 11:31:21 AM UTC-5, Adrian Edwards wrote:
form = SQLFORM(db.entries)
form.vars.date_entered = date.today()
form.vars probably needs a string representation instead of a date object.
Instead, maybe set the field's default value:
I can't see it either.
Oops — this shared file or folder link has been removed
No proxies whatsoever. Odd...
Perhaps someone could post it on another file sharing service and provide a
link?
how about create a models/startup.py
def startupcode():
db.commit()
import os
os.rename(os.path.join(request.folder,'models','startup.py'),
os.path.join(request.folder,'private','startup.py'))
startupcode()
On Nov 22, 10:08 am, petrasadi petras...@gmail.com wrote:
In
I thought the same thing and so made date_entered capable of being
empty and removed it from the form.
Same result
But I did find a hack workaround and it makes me wonder if my problem
has to do with the user field being a foreign key and SQLFORM not
liking that its empty (since I populate just
On Tue, Nov 22, 2011 at 9:21 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
must be hashed
Hmm I can't seem to get this working. I should probably have mentioned
that we are using basic auth to use this user on the client side. When
I hash the password and insert it into the database it
I think we need Massimo opinion on this...
Richard
On Thu, Nov 17, 2011 at 12:16 PM, ~redShadow~ redsha...@hackzine.orgwrote:
On Wed, 2011-11-16 at 15:36 -0500, Richard Vézina wrote:
Man!
I think you got a nice solution for this exact problem...
I had tried with jQuery in the
If the password is a UUID how are the users supposed to know what it
and use it to login. I am missing something here.
On Nov 22, 12:08 pm, Matt Broadstone mbroa...@gmail.com wrote:
On Tue, Nov 22, 2011 at 9:21 AM, Massimo Di
Pierromassimo.dipie...@gmail.com wrote:
must be hashed
Hmm I
I have a linux server (centos)
When I set up my remote server, it works fine with the rocket server.
However when I use uwsgi, it starts as a different user to root, and
root is the owner of the web2py directories. So web2py does not work
because it cannot write to the directories. Does anyone
On Tue, Nov 22, 2011 at 1:32 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
If the password is a UUID how are the users supposed to know what it
and use it to login. I am missing something here.
its a temporary password, for a one time callback.
On Nov 22, 12:08 pm, Matt Broadstone
I lost some time this afternoon fighting against a bug that was
already solved, but I didn't see it working.
I'm importing a python module in myapp/modules folder. Changes I made
there wasn't saw in browser processing.
The only way to make it work was restarting web2py server.
Is there any
Hi Folks!
I'm using the latest stable version of web2py and I was trying mail.send +
'logging' to test some emails... This is what I got:
mail.send(to='m...@email.com')
and this is what I get on my console:
WARNING:web2py:email not sent
From:
On Tue, Nov 22, 2011 at 2:31 PM, Matt Broadstone mbroa...@gmail.com wrote:
On Tue, Nov 22, 2011 at 1:32 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
If the password is a UUID how are the users supposed to know what it
and use it to login. I am missing something here.
its a
I'm trying to access a new webapp that I've deployed to a new GAE
Python Dev Web Server. When I hit the default URL (http://localhost:
8080) I get the following error:
dev_appserver.py:1069] Encountered error loading module
gaehandler
I'm using the example app.yaml that came with my
It give this error:
Traceback (most recent call last):
File /home/angelo/DEV/web2py-dev/gluon/main.py, line 493, in wsgibase
serve_controller(request, response, session)
File /home/angelo/DEV/web2py-dev/gluon/main.py, line 187, in
serve_controller
environment =
thank you for this, but I have one more question: is this guarantied to
execute only once (upon installation).
On Tuesday, November 22, 2011 3:00:46 PM UTC-5, Matt wrote:
Aren't passwords always hashed when entered in the database?
Not necessarily. You have to have the CRYPT() validator on the password
field for hashing. It is there by default, but is not required and could be
removed.
Anthony
In Python, imported modules don't reload automatically. In web2py, you can
tell it to reload whenever there is a change by adding the following:
from gluon.custom_import import track_changes
track_changes(True)
See
On Tue, Nov 22, 2011 at 3:50 PM, Anthony abasta...@gmail.com wrote:
On Tuesday, November 22, 2011 3:00:46 PM UTC-5, Matt wrote:
Aren't passwords always hashed when entered in the database?
Not necessarily. You have to have the CRYPT() validator on the password
field for hashing. It is there
Hi Peter,
I'm using Apache and WSGI but this should work the same.
I always run chown apache:web2py -R on an new application folder.
Apache is the user that Apache is running as and web2py is the user (and
group) that WSGI is running as.
It is never good to run anything as root.
Kenneth
I haven't been following the discussion. Do you want to remove the CRYPT
validator? If so, I think something like:
db.auth_user.password.requires = None
Anthony
On Tuesday, November 22, 2011 3:57:18 PM UTC-5, Matt wrote:
On Tue, Nov 22, 2011 at 3:50 PM, Anthony abas...@gmail.com wrote:
On
Hello again,
This time I have a form design question.
I have a view who's content is date dependent where if date.today() is
in-between start_date and end_date then a SQLFORM is displayed.
Otherwise display a custom message, i.e. Time has expired.
In my first solution I added the logic in the
hmmm, that's odd. try re-downloading web2py?
either way, gaehandler is here:
http://code.google.com/p/web2py/source/browse/gaehandler.py
(note that is the trunk version which may or may not match the latest
released version.
cfh
actually, unless something changed on on GAE, select caching does not work
because the rows object is not picklable.
the @cache decorator caches the dict that you return to the view, not the
rendered view. if something in that dict is not picklable (say a rows
object) the cache will fail.
That bug has been fixed in trunk. It's only the 'logging'
visualization that was wrong, don't worry...
On 22 Nov, 20:54, Tito Garrido titogarr...@gmail.com wrote:
Hi Folks!
I'm using the latest stable version of web2py and I was trying mail.send +
'logging' to test some emails... This is
I have run into the above as well.
Likely the issue is that on update you are not returning all values that
the 'compute' field is based upon.
Ex:
db.define_table('test',
Field('val1', 'double'),
Field('val2', 'double'),
Field('result',
compute = lambda r: r['val1'] + r['val2'])
)
One way to do it. There are others I'm certain...
Controller
if time_in_range:
form = SQLFORM(
if something_else:
form = 'something else' # or any expression you like
if another_thing:
form = 'another thing'
return dict(form=form)
If you want to use different views, check
Thanks Cliff. I like your suggestion better. Now I can simply have the
view check
if type(form) is SQLFORM):
display form
else:
...display message
On Nov 22, 5:05 pm, Cliff cjk...@gmail.com wrote:
One way to do it. There are others I'm certain...
Controller
if time_in_range:
form
I should mention that I don't really use CRUD. So I've assumed the above
scenario is the same as using CRUD / sqlform.smartgrid.
Also, you may want to look into Virtual Fields if you don't need to
actually store the data. These are computed upon retrieval of records, not
insertion / updates.
yes because the file gets moved in a different folder after execution.
It is a bit of a hack.
We should think of a better way
On Nov 22, 2:41 pm, petrasadi petras...@gmail.com wrote:
thank you for this, but I have one more question: is this guarantied to
execute only once (upon installation).
select(cache) does not serielizes Rows but the dictionary returned by
the select. I have never tried it on GAE. For sure you cannot cache in
run but it should be possible to cache.memcache. If that does not work
it is because the datastore returns a type that is not serializible.
On Nov 22, 3:26
Massimo's solution sure is cunning, but you might something like this
a bit more maintainable:
def install():
if db(db.auth_group.id 0).count() == 0:
db.auth_group.insert(role = 'edit')
db.auth_group.insert(role = 'moderate')
db.auth_group.insert(role = 'comment')
You can simplify the view further if you always return something named
form.
I'm biased in favor putting as much logic as possible in the models
controllers.
On Nov 22, 5:09 pm, Adrian Edwards aedward...@gmail.com wrote:
Thanks Cliff. I like your suggestion better. Now I can simply have the
On Tue, Nov 22, 2011 at 4:11 PM, Anthony abasta...@gmail.com wrote:
I haven't been following the discussion. Do you want to remove the CRYPT
validator? If so, I think something like:
db.auth_user.password.requires = None
This seems to have fixed the issue, thank you both
Matt
Anthony
On
On Nov 21, 6:42 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
Please try the nightly build and let me know.
I didn't check out the whole nightly build, but just replaced
rocket.py and that seems to have fixed it.
Matt
On Nov 21, 10:07 am, Matt mbroa...@gmail.com wrote:
On
Though that will do an unnecessary db query on every request after the
install. Anyway, you can do:
if db.auth_group.isempty():
Anthony
On Tuesday, November 22, 2011 6:59:58 PM UTC-5, Limedrop wrote:
Massimo's solution sure is cunning, but you might something like this
a bit more
I think that makes sense, putting the logic in the controllers.
Thanks for the feedback.
On Nov 22, 7:38 pm, Cliff cjk...@gmail.com wrote:
You can simplify the view further if you always return something named
form.
I'm biased in favor putting as much logic as possible in the models
Why not set ownership of web2py files to whatever uwsgi is expecting?
There is a ticket about this
http://code.google.com/p/web2py/issues/detail?id=464
You can remove this line and everything still works normally.
On Tue, Nov 22, 2011 at 6:34 PM, Angelo Compagnucci
angelo.compagnu...@gmail.com wrote:
It give this error:
Traceback (most recent call last):
I missed yor response. I will remove the line.
On Nov 22, 10:00 pm, Bruno Rocha rochacbr...@gmail.com wrote:
There is a ticket about
thishttp://code.google.com/p/web2py/issues/detail?id=464
You can remove this line and everything still works normally.
On Tue, Nov 22, 2011 at 6:34 PM,
Ed,
Sorry, I looked at the URL in your second message www.box.com and that
works. The URL in your first message to a specific shared file gives me a
404 response too.
This is a file sharing site like dropbox so it appears the file owner has
removed it.
I tried a few of the web page archives
70 matches
Mail list logo