Denes,
> About the asterisks in col3, you have to use your form's field names
> as in:
> col3=dict(initialen='*', naam='*', ...)
> form[0][-1][1].append(INPUT(_type='reset',_value='Reset'))
> form[0][-1][1].append(INPUT(_type='button',_value='Cancel'))
This all works. The form[0][-1][1] code is
Denes,
> About the asterisks in col3, you have to use your form's field names
> as in:
> col3=dict(initialen='*', naam='*', ...)
> form[0][-1][1].append(INPUT(_type='reset',_value='Reset'))
> form[0][-1][1].append(INPUT(_type='button',_value='Cancel'))
This all works. The form[0][-1][1] code is
Massimo,
Indeed, it is a DB error. It had something to do with the Sequences in
PostgreSQL.
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to
Pynthon,
Indeed, a bit off-topic, but you're right, I'm Dutch too.
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To
Denes,
> Strictly speaking only reset is valid HTML.
> But you can create any button you want.
> How? it depends on what do you want to do with it.
> In your case, what is "Cancel" going to do?.
> To add a reset button:
> form[0].append(TR(TD(),TD(INPUT(_type="reset",_value="Reset form")))
> f
Denes,
> Strictly speaking only reset is valid HTML.
> But you can create any button you want.
> How? it depends on what do you want to do with it.
> In your case, what is "Cancel" going to do?.
>
> To add a reset button:
> form[0].append(TR(TD(),TD(INPUT(_type="reset",_value="Reset form")))
>
>
Massimo,
After adding col3=dict() my form reads like:
def contact():
response.functionname=T('Contact')
response.image=URL(r=request,c='static',f='media/core/banner.png')
form=form_factory(SQLField('bedrijfsnaam'),\
SQLField('u_bent',label='U bent',requires=IS_IN_SET(['de
heer',
Yarko and Denes,
>if club[0].status == '0':
was what I was looking for.
Denes, your explanation made clear why I have to use this syntax,
thanks, I copied and paste it to my log.
Best regards,
Annet.
--~--~-~--~~~---~--~~
You received this message because you
Yarko,
I am afraid I failed to describe the problem clearly.
I have a table:
db.define_table('bedrijf',
SQLField('bedrijfsnaam', length=54, default='', notnull=True),
SQLField('kvk_nummer', length=8),
SQLField('subdossiernummer', length=4, default=''),
SQLField('rechtsvorm',
Massimo,
I am a bit closer to getting my event list to display the dates
properly.
The following error was solved replacing fromdate=request.vars.datum
with fromdate=form.vars.datum
fromdate=request.vars.datum
todate=form.vars.datum+datetime.timedelta(days=int(form.vars.dagen))
Exposing the fu
I am still struggling with the formatting of date, I first tried to
solve the problem the best way, when I didn't get that to work I
thought I'd try the quick fix, unfortunately, resulting in the same
errors.
This works, however, the date is displayed in the format: -mm-dd,
whereas I need dd
Massimo,
I sent you the file by mail.
I am using PostgreSQL 8.3
Annet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To u
Massimo,
> SQLField('datum',type='date',requires=IS_DATE(str(T('%Y-%m-%d'
I changed this.
> The main problem is here:
>
> > fromdate=request.vars.datum
> > todate=IS_DATE()(fromdate)[0]+datetime.timedelta(days=int(request.vars.dage
> > n))
These lines now read like:
fromdate=request.v
Denes,
> form_factory already gives you the dropbox using the OptionsWidget.
> Do you want something different?.
No, I would like to use the OptionWidget. I had a look at the
OptionsWidget class in gluon/sqlhtml file, but wasn't able to figure
out how to use it in a function.
form=form_factory
Massimo,
I had to add:
T.force('en-nl')
to db.py to get the strings translated.
This introduced the following error:
File "/Library/Python/2.5/site-packages/web2pyfitwise/applications/
core/controllers/eventlist.py", line 25, in byplace
todate=IS_DATE()(fromdate)[0]+datetime.timedelta(da
The problem described above, seems to have something to do with the
language file being ignored. I a function I have the following string
constants marked by T
response.functionname=T('Club locator by place')
response.flash=T('Form has errors')
response.flash=T('Please fill the form')
The en-nl
I tried:
> Two: change the validators to read like:
>
> db.event.datum.requires=[IS_DATE(str(T('%Y-%m-%d'))), IS_NOT_EMPTY()]
> db.event.einddatum.requires=IS_DATE(str(T('%Y-%m-%d')))
>
> and create a language file en-nl.py.
Translations:
OriginalTranslation
%Y
I am not sure I complete get the implication of your answer. Are you
saying I have two options?
One: leave the model as it is:
db.define_table('event',
SQLField(...),
SQLField('datum', type='date', default='', notnull=True,),
SQLField('einddatum', type='date'),
SQLField('...),
Massimo,
>SQLField(...widget=...)
>there are some examples in gluon/sqlhtml.py but your way of doing it
>is the easiest way.
I think I prefer the widget, the easiest way is not always the most
beautiful way. I had a look at the gluon/sqlhtml.py file, I suppose
the OptionsWidget is the one I need
Massimo,
Happy Easter to you too.
Your reply solved my problem, however, I encountered another problem.
The function of this use case reads like:
def byplace():
form=form_factory(SQLField('plaats',requires=IS_NOT_EMPTY(),\
widget=lambda self, value:INPUT
(_id='eventbyplace',_name='plaa
Thanks that was helpful. I followed your advice.
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from
Denes and Alvaro,
Thanks for your replies.
The by place function now reads like:
def byplace():
response.functionname=T('Club locator op plaats')
response.image=URL(r=request,c='static',f='media/core/banner.png')
form=form_factory(SQLField('plaats',requires=IS_NOT_EMPTY(),\
widg
Denes,
You are right, in the PostgreSQL documentation it says that LIKE only
works on fields of type string.
I reconsidered the model:
db.define_table('zipcoderegions',
SQLField('region', type=integer, default='',notnull=True),
SQLField('codemin', type=integer, default='', notnull=True
I reread my functions, and came across this one:
def details():
id=request.args[0]
club=db(db.bedrijf.id==id).select()
address=db((db.adres.bedrijf==id)&
(db.adres.adressoort=='vestigingsadres')).select()
nfas=db((db.bedrijfnfa.bedrijf==id)&
(db.bedrijfnfa.nfatype==db.nfatype.id)
Denes,
> The auto-complete part was not mentioned in this thread but it should
> be OK as per your logic, except for the extreme case where the
> selected postcoderegio is deleted while the form is being shown.
I guess it is best to take this extreme case into account, the code
now reads:
if f
Denes,
> OK but you should check if minmax is not empty first.
I thought this wouldn't be necessary since the input comes from an
auto-complete or drop-box, and these contain values that are in the
zipcoderegions table for sure.
However, that's my logic, now that you mention checking if minmax
Denes,
Problem solved:
minimum=int(minmax.codemin)
maximum=int(minmax.codemax)
Should read:
minimum=int(minmax[0].codemin)
maximum=int(minmax[0].codemax)
Why?
> > db.define_table('zipcoderegions',
> > SQLField('region', type=integer, default='',notnull=True),
> > SQLField('codemin',
Denes,
I adjusted the form: type='integer' and _type='integer'
form=form_factory(SQLField('postcoderegio',type='integer',
requires=IS_NOT_EMPTY(),\
widget=lambda self,value:TAG[''](INPUT
(_id='byzipcode',_name='postcoderegio',_class=\
'ac_input',_type='integer'
and the handler in /cor
Denes,
Thanks for you reply. The function now reads like:
def byzipcode():
form=form_factory(SQLField('zipcoderegion',requires=IS_NOT_EMPTY
()))
if form.accepts(request.vars,session):
minmax=db(db.zipcoderegions.region==request.vars.zipcoderegion)
\
.select(db.zipcodereg
Massimo and Denes,
Thanks for your help. IS_MATCH() solved my problem. IS_INT_IN_RANGE
(1000,) wouldn't have performed the right validation, it excludes
.
Annet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
Given this model:
db.define_table('zipcoderegions',
SQLField('region', type=integer, default='',notnull=True),
SQLField('codemin', type=integer, default='', notnull=True),
SQLField('codemax', type=integer,, default='', notnull=True),
migrate=False)
and the values in the zipcoder
Given this model:
db.define_table('zipcoderegions',
SQLField('region', type=integer, default='',notnull=True),
SQLField('codemin', type=integer, default='', notnull=True),
SQLField('codemax', type=integer,, default='', notnull=True),
migrate=False)
and the values in the zipcoder
Given this model:
db.define_table('zipcoderegions',
SQLField('region', type=integer, default='',notnull=True),
SQLField('codemin', type=integer, default='', notnull=True),
SQLField('codemax', type=integer,, default='', notnull=True),
migrate=False)
and the values in the zipcoder
Denes,
> same here, IS_LENGTH is invalid with integers (numbers don't have a
> length property in Python).
I didn't know that, however, removing the IS_LENGTH() validator solved
the problem )after finishing the first version of the application I am
working on I'll definitely have to dive into P
I don't know, in the function I want to use the following code
if form.accepts(request.vars,session):
code=db(db.postcoderegio.regio==request.vars.regio).select
(db.postcoderegio.min,db.postcoderegio.max)
clubs=db().select(db.company.ALL,db.address.ALL,left=db.address.on
(
(db.addres
Denes,
Thanks for pointing me in the right direction, the {{pass}} was
missing here:
{{pass}}
After fixing this problem I found out something else. I made a static
layout; plain xhtml and a css. When I use this layout in web 2py the
header and footer display alright, however th
Denes,
Where and how do I display db._lastsql?
The example comes from: http://mdp.cti.depaul.edu/examples/default/dal
the example about Left Outer Joins
I guess the idea of the example in SQL reads like:
SELECT person.name, dog.name
FROM person
LEFT OUTER JOIN friendship ON person.id==friend
Massimo,
Thanks for your answering my questions, it helps me get the bigger
picture of tools.py.
Kind regards,
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this g
38 matches
Mail list logo