Your code seem ok, maybe traceback could help... Or you can look at the
line poited by the traceback... Maybe you forgot "db." somewhere in front
of ts_mileage_rate

Can't say from you code, because it seems ok there. I thought it was caused
by the IS_NOT_IN_DB at first but I don't think so.

Good luck.

Richard


On Wed, Jul 24, 2013 at 5:03 PM, <msar...@gmail.com> wrote:

> I am trying to use the method posted by
> http://stackoverflow.com/questions/8054665/multi-column-unique-constraint-with-web2py
>
>     db.define_table('ts_customer',
>                 Field('customer_name', 'string', length=80, required=True,
> unique=True))
>
>     db.define_table('ts_mileage_rate',
>                 Field('customer_id', 'reference ts_customer',
> required=True, notnull=True),
>                 Field('mileage_rate_year', 'integer', required=True,
> notnull=True,
>                       requires=IS_NOT_IN_DB(
>                           db(db.ts_mileage_rate.customer_id ==
> request.vars.customer_id),
>                           'ts_mileage_rate.mileage_rate_year')
>                 ))
>
> I get the following error:
>
> type 'exceptions.AttributeError'> 'DAL' object has no attribute
> 'ts_mileage_rate'
>
> Any idea why?
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to