Ok so if i have a table in my db named homepage as below:-
--
id | data |
---
1 | vivek|
--
2 | andrew|
---
Now if I want to retrieve only the last row .. i can do this
Hi
I have the following table:
db.define_table(products,
Field(categoryID, db.productCategory, writable=False,
readable=False, requires=IS_IN_DB(db, productCategory.id,
productCategory.name) ), # reference field
Field(productName, 'string',length=512, default=None),
Something like this in the controller:
eventtyperows=db(db.event.eventtype==db.eventtype.id).\
select(db.event.eventtype,db.eventtype.eventtype,\
distinct=True,orderby=db.eventtype.eventtype)
a=[e.event.eventtype for e in eventtyperows]
b=[e.eventtype.eventtype for e in eventtyperows]
I have the following code in a view:
ul
{{for row in rows:}}
li{{=row.facility}}/li
{{pass}}
/ul
The length of rows varies. I would like to split the list in two list
and display it in two columns instead of one. Is it possible to do
this in the view, or should the function return rows_1
One way of solving this would be like this:
table
{{counter = 1}}
{{for row in rows:}}
{{if counter == 1:}}
trtd{{=row.facility}}/td
{{counter = 2}}
{{else:}}
td{{=row.facility}}/td/tr
{{counter = 1}}
{{pass}}
{{pass}}
/table
Kenneth
I have the following
Perfect
I think this can be added to the relevant section of the book, I
didn't find anything about that, also on the internet...
Thanks a lot, though.
Niphlod
On 8 Set, 03:08, mdipierro mdipie...@cs.depaul.edu wrote:
Sorry for the lat reply. This is not a bug. This is a design issue
Hi Kenneth,
Thanks for your instant reply, problem solved!
Kind regards,
Annet
Yes but i think this is gae thing. You try? with max(id) or add some
datetime field and order by this field like Field('created_on',
'datetime',
default=datetime.datetime.today(),writable=False,readable=False)
On 9 sep, 03:06, b vivek bvivek1...@gmail.com wrote:
Ok so if i have a table in my db
Hello,
I'm trying to deploy web2py with cherokee on a fedora core 13 distro
but I have several problems on it. I have read the slice web2py with
Cherokee via uWSGI: a simple, easy guide that it could be found in
web2pyslices but this guide is outdated because it seems to be done
for an older
Hi,
I have this test case:
1. User registers in app.
2. App sends him greeting email (Welcome to so-and-so app).
3. App adds his email/name etc to mailing application (like Mailchimp)
for auto-subscribing to newsletter.
Now user expects steps 1 completion to take him to the next 'default/
http://www.scribd.com/doc/37113340/Why-Django-Sucks-and-How-we-Can-Fix-it
It would be interesting to head community's thoughts on some of the
problems there. :)
Il giorno 09/set/2010, alle ore 12.42, salbefe ha scritto:
Hello,
I'm trying to deploy web2py with cherokee on a fedora core 13 distro
but I have several problems on it. I have read the slice web2py with
Cherokee via uWSGI: a simple, easy guide that it could be found in
web2pyslices but
Thank you!
On Sep 8, 11:45 pm, Relsi Hur relsi.ram...@gmail.com wrote:
Hi Massimo,
I have here an editable version of the document which I will translate
to Portuguese soon, if you want to catch:
https://docs.google.com/document/edit?id=14jfi7HUf-F41N6HHvqx87S3GTHQ...
I want to do some preprocessing before permitting SQLFORM to delete a
record:
topic = db.topic[topic_id]
form = SQLFORM(db.topic, topic)
if form.accepts(request.vars, session, dbio=False):
if form.vars.get('delete_this_record'):
response.flash = 'Delete intercepted'
else:
I am using the following simple routes.py and find it works fine on
GAE with latest trunk:
routes_in = (
('/', '/init/default/index'),
('/topics', '/init/topics/index'),
)
routes_out = [(second, first) for (first, second) in routes_in]
On Sep 9, 9:49 pm, mdipierro
oops. fixed in trunk
On Sep 9, 7:50 am, Richard richar...@gmail.com wrote:
I want to do some preprocessing before permitting SQLFORM to delete a
record:
topic = db.topic[topic_id]
form = SQLFORM(db.topic, topic)
if form.accepts(request.vars, session, dbio=False):
if
I do not understand where unable to import Rocket comes from.
On Sep 9, 8:03 am, Richard richar...@gmail.com wrote:
I am using the following simple routes.py and find it works fine on
GAE with latest trunk:
routes_in = (
('/', '/init/default/index'),
('/topics',
On 9 sep, 07:42, salbefe salb...@gmail.com wrote:
Hello,
I'm trying to deploy web2py with cherokee on a fedora core 13 distro
but I have several problems on it. I have read the slice web2py with
Cherokee via uWSGI: a simple, easy guide that it could be found in
web2pyslices but this guide
On Sep 9, 2010, at 6:27 AM, mdipierro wrote:
I do not understand where unable to import Rocket comes from.
That's a strange error. Also, the syntax error on routes.py is on line 3, which
is empty; there's no code until line 4.
My advice is to resolve the first error (Rocket) before worrying
gaehanlder.py does not import Rocket. Is it possible gaehandler.py or
app.yaml were modified?
On Sep 9, 9:40 am, Jonathan Lundell jlund...@pobox.com wrote:
On Sep 9, 2010, at 6:27 AM, mdipierro wrote:
I do not understand where unable to import Rocket comes from.
That's a strange error.
On Sep 9, 2010, at 7:49 AM, mdipierro wrote:
gaehanlder.py does not import Rocket.
main imports Rocket
Is it possible gaehandler.py or
app.yaml were modified?
On Sep 9, 9:40 am, Jonathan Lundell jlund...@pobox.com wrote:
On Sep 9, 2010, at 6:27 AM, mdipierro wrote:
I do not
try:
import rocket
except:
logging.warn('unable to import Rocket')
True. This is supposed to fail on GAE. I will change it. No need to
try the import and issue a warning on GAE.
On Sep 9, 9:57 am, Jonathan Lundell jlund...@pobox.com wrote:
On Sep 9, 2010, at 7:49 AM, mdipierro wrote:
On Sep 9, 2010, at 9:17 AM, mdipierro wrote:
try:
import rocket
except:
logging.warn('unable to import Rocket')
True. This is supposed to fail on GAE. I will change it. No need to
try the import and issue a warning on GAE.
...which leaves the mystery of the routes syntax error.
I tried to execute web2py as windows service, using following command:
C:\web2py python web2py.py -W install
the response was:
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.81.5 (2010-07-22 23:56:21)
Database drivers available: SQLite3, MSSQL/DB2
Thinking about this I can't picture it. So do you render the parent-
child form on the server? If so do you just render inputs for one
child? Or do you pick n number of child forms to render with the
parent?
I've done parent - child on one form. At least it looked that way
to the user. But
Hello,
This works fine:
uwsgi --pythonpath /var/web2py --module wsgihandler -s /tmp/
we2py.sock --http :9090
If I point to localhost:9090 works ok and I see the welcome
application.
After that:
If I make a config.xml file as is described on
http://projects.unbit.it/uwsgi/wiki/Example
and I
Hello,
This works fine:
uwsgi --pythonpath /var/web2py --module wsgihandler -s /tmp/
we2py.sock --http :9090
If I point to localhost:9090 works ok and I see the welcome
application.
After that:
If I make a config.xml file as is described on
Hi, I think I found a problem (bug?) with crud.create and
form.custom.end:
I have the following model:
db.define_table('contents',
Field('name', 'string', required=True, notnull=True,
requires=IS_NOT_EMPTY()),
Field('ordering', 'integer', required=True,
requires=IS_NOT_EMPTY()),
Hi Massimo,
in sql.py and dal.py
def as_dict(self,datetime_to_str=False):
d = dict(self)
for k in copy.copy(d.keys()):
v=d[k]
if isinstance(v,Row):
d[k]=v.as_dict()
elif isinstance(v,Reference):
d[k]=int(v)
because you cannot .accepts a crud forms. It is implicit. You can do
def index():
form = crud.create(db.contents,message='Inserted')
return dict(form=form)
On Sep 9, 2:51 pm, Álvaro J. Iradier airad...@gmail.com wrote:
Hi, I think I found a problem (bug?) with crud.create and
Nice mention of web2py about the application object.
I've run into a snag with web2py by not knowing I should have have
UUID primary keys... Is this something that could be handled at the
web2py level and not within the app/model itself? Would this be
similar to what the author means by late
Others may have more experience with this, but it sounds like your
example could be handled with a cron job that periodically checks for
newly registered users. On GAE, you also have the option to use a
task queue.
On Sep 9, 7:05 am, Adi aditya.sa...@gmail.com wrote:
Hi,
I have this test
looking at /var/log/cherokee/error_log that is what I get:
[uWSGI] parsing config file /var/web2py/config.xml
*** Starting uWSGI 0.9.6 (32bit) on [Thu Sep 9 23:37:45 2010] ***
compiled with version: 4.4.4 20100630 (Red Hat 4.4.4-10)
Python version: 2.6.4 (r264:75706, Jun 4 2010, 18:20:16)
[GCC
The mention was about web.py not web2py
2010/9/9 johntynan jgty...@gmail.com
Nice mention of web2py about the application object.
I've run into a snag with web2py by not knowing I should have have
UUID primary keys... Is this something that could be handled at the
web2py level and not
Where do you see the reference to web2py in the document. I did not
see it.
web2py allows for keyed tables (not on all supported database) and a
key can be uuid.
yes forms will not work well with it (at least I never tried) and
web2py was designed with an integer ID in mind.
This is not a
This app
http://vizworkshop.cct.lsu.edu/viz2010
Stored here:
http://code.google.com/p/hevw/
Does what you asked. Look into the lola function:
http://code.google.com/p/hevw/source/browse/models/db.py
On Sep 9, 6:05 am, Adi aditya.sa...@gmail.com wrote:
Hi,
I have this test case:
Using the test code you provided before, I now get this error:
---
Traceback (most recent call last):
File C:\Users\Dave\Documents\Python\web2py\gluon\restricted.py,
line 188, in restricted
exec ccode in environment
File
looking at /var/log/cherokee/error_log that is what I get:
[uWSGI] parsing config file /var/web2py/config.xml
*** Starting uWSGI 0.9.6 (32bit) on [Thu Sep 9 23:37:45 2010] ***
compiled with version: 4.4.4 20100630 (Red Hat 4.4.4-10)
Python version: 2.6.4 (r264:75706, Jun 4 2010,
in my case I was using the following routes.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
default_application = 'reviewround' # ordinarily set in base routes.py
default_controller = 'default' # ordinarily set in app-specific
routes.py
default_function = 'index'
routes_in = ( ('/',
On Sep 9, 2010, at 9:07 PM, Miguel Goncalves wrote:
in my case I was using the following routes.py
What I'm looking for is the file itself (preferably zipped). I'm wondering if
there might be something in it that isn't surviving a paste into email, because
I don' t seen anything in line 3 that
Wow so fast. Massimo you are amazing!
On Sep 9, 11:26 pm, mdipierro mdipie...@cs.depaul.edu wrote:
oops. fixed in trunk
On Sep 9, 7:50 am, Richard richar...@gmail.com wrote:
I want to do some preprocessing before permitting SQLFORM to delete a
record:
topic = db.topic[topic_id]
form
I don't know a good general solution for web2py, but if just targeting
GAE:
1) request all existing products
2) find which of your products are new
3) insert new products in a single operation using the GAE API:
db.put(list_of_models)
And if you have timeouts then break it up with Task Queues.
Question: Will the function lola execute in a different thread or
something?
On Sep 10, 2:50 am, mdipierro mdipie...@cs.depaul.edu wrote:
This app
http://vizworkshop.cct.lsu.edu/viz2010
Stored here:
http://code.google.com/p/hevw/
Does what you asked. Look into the lola function:
Want to avoid cron. Crons need to run in a separate web2py instance,
and there are some issues we've faced in keeping that alive and
running without memory issues.
-- Aditya
On Sep 10, 2:16 am, Michael Ellis michael.f.el...@gmail.com wrote:
Others may have more experience with this, but it
Ya that is true.. Have been following the mailing list closely and will
definitely agree with you..Massimo is amazing. In fact Massimo is to
web2py what Guido is to python... wow that does sound good! :-)
On Fri, Sep 10, 2010 at 9:58 AM, Richard richar...@gmail.com wrote:
Wow so fast.
Thanks Massimo - that'd be very welcome. I've installed pyodbc on several
occasions to use with web2py, and it'd be very handy to have it bundled
Now about that CouchDB interface... ;-
Regards
Dave M.
On 4 September 2010 02:40, mdipierro mdipie...@cs.depaul.edu wrote:
We are considering
Thanks Massimo.
It's impossible to have better support than web2py, you and this
community are impressing, five stars!
So, assumming I'm doing other things between the crud.create and the
return:
def index():
form = crud.create(db.contents,message='Inserted')
... #other code
return
47 matches
Mail list logo