I have defined two tables:

db.define_table('doelgroep',
    db.Field
('doelgroep',length=24,default='',notnull=True,unique=True),
    migrate=False)


db.define_table('event',
    db.Field
('bedrijf',db.bedrijf,default='',notnull=True,ondelete='CASCADE'),
    ...
    db.Field('doelgroep',db.doelgroep,ondelete='RESTRICT'),
    ...
    migrate=False)


I a function I have the following lines of code:

def index():
    ...
    events=db((db.event.bedrijf==1)&(db.event.van_datum>=request.now)&
\
    (db.event.doelgroep==1)&(db.event.scope==2))\
    .select
(db.event.id,db.event.event,db.event.event_zin,db.event.van_datum,\
    orderby=db.event.van_datum,limitby=(0,1))
    ...
    return dict(events=events)


executing this code results in a error tickets which reads like:

ProgrammingError: operator does not exist: character varying = integer
LINE 1: ...event.van_datum>='2009-10-21') AND event.doelgroep=1) AND
ev...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You
might need to add explicit type casts.


Where the ^ points to the  = sign in doelgroep=1


How do I solve this problem. Why doesn't 'db.event.bedrijf==1' result
in an error, to me both expressions are the same.


Kind regards,

Annet
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to