I get an error if I try to copy a row that has a date field.
import copy
db.define_table('test_table', db.Field('test_field', 'date'), migrate=True)
db.test_table.insert(test_field='2010-12-20')
1
row = db(db.test_table.id==1).select()[0]
row_copy = copy.copy(row)
Traceback (most recent
I was able to get around the problem by converting the row to a
dictionary.
import copy
db.define_table('test_table', db.Field('test_field', 'date'), migrate=True)
db.test_table.insert(test_field='2010-12-20')
1
row = db(db.test_table.id==1).select()[0]
row_copy = copy.copy(row.as_dict())
Does it make sense to modify the gluon.sql Expression __invert__
method so a double invert is possible.
Currently this produces an error:
print db().select(db.person.name, orderby=~~db.person.name)
ProgrammingError: (1064, You have an error in your SQL syntax;
check the manual that
Thanks for the quick response. Very much appreciated!
Cheers,
Jim Karsten
On Nov 29, 4:34 pm, mdipierro mdipie...@cs.depaul.edu wrote:
I apologize for my too quick previous dismissal. On a second thought
this is a good idea. Your patch is in trunk.
massimo
Should dal.py be patched as well?
On Oct 6, 9:32 am, mdipierro mdipie...@cs.depaul.edu wrote:
I i have fixed this (partially) partially since as_dict is used in
json serialization and thereforedecimalis converted into float.
mdipierro wrote:
because keyword appears both in get and in post. You can try:
form=SQLFORM.factory(
Field('keyword',
default=keyword,
)
_method=GET)
or
form=SQLFORM.factory(
I am trying to provide a default value for an input textbox using
request.vars but am seeing some unusual behaviour.
Here is my controller:
def search():
keyword = ''
if 'keyword' in request.vars:
keyword = request.vars.keyword
form=SQLFORM.factory(
I am working on a plugin that allows a user to select from several
options. I have a page with a form and the plugin. When the form
submits, the controller saves the form data but also needs to record
the option selected in the plugin. How can this be done?
My current method is to use jquery. The
Here is the proof of concept I am using.
models/db.py
db.define_table('customer',
db.Field('name'),
db.Field('phone'),
migrate=True,
)
db.define_table('product',
db.Field('name'),
migrate=True,
)
db.define_table('purchase',
I am trying to get my head around using pyjamas with web2py. I like
the benefits of pyjamas, cross browser compatibility and coding in
python, but all the applications I tested, the example in the web2py
book and the ones in the pyjamas book, create a complete page, opening
html tag to closing
I am considering developing a web2py small business Accounting
application but I thought I check to see if anyone has created
something already. I'm looking for General Ledger, Receivables and
Payables, and possibly payroll.
Anyone know of such an appliance or of someone developing one?
When I run python web2py --upgrade=yes, the admin and welcome
applications are upgraded. I don't see any changes to the scripts in
the gluon directory. How do I upgrade those files so I can get the
most recent features and bug fixes?
--
Subscription settings:
Sorry for the delay in replying. I finally had a chance to test this
and it certainly works well enough. Thanks.
Regards,
Jim
On Jan 11, 11:30 pm, mdipierro mdipie...@cs.depaul.edu wrote:
Or better:
def balloon(comment)
return DIV('[read more]',SPAN(comment),_class='balloon')
I have a form where one field requires a comment to explain what to
enter. The explanation is quite lengthy so I'd rather replace it with
a link or a help
icon. I can't figure out a way to do this.
Currently:
form=form_factory(
db.Field('title',
default='default title',
settings be inserted? I see settings in these files
applications//models/db.py
applications//private/settings.py
and they are also stored in a database table.
Thanks,
iiijjjiii
--~--~-~--~~~---~--~~
You received this message because you
15 matches
Mail list logo