Hi!, 
Thank you for your interest Ales, 
This is my entire table, now it has other fields:
db.define_table('OffersCity', 
                Field('city', db.City), 
                Field('offer', db.Offer),
                Field('hotel', db.Hotel), 
                Field('order', 'decimal(3,0)', default=0),
                Field('day', 'date', default = request.now), 
                Field('definitive', 'boolean', default = False))

db.OffersCity.offer.requires = IS_IN_DB(db,db.Offer, "%(id)s")
db.OffersCity.city.requires = IS_IN_DB(db,db.City, "%(id)s")
db.OffersCity.hotel.requires = IS_IN_DB(db,db.Hotel, "%(name)s")
db.OffersCity.day.requires = [IS_NOT_EMPTY(), IS_DATE(format=DATEFORMAT)]





This is the Offer (the linked table I need)

db.define_table('Offer',
                Field('init_num_rooms', label="Número de habitaciones", 
default=1),
                Field('remaining_rooms', 
default=request.post_vars.init_num_rooms, readable=False, writable=False), 
                Field('normal_price', 'decimal(10,2)', label="Precio 
normal"),
                Field('offer_price', 'decimal(10,2)', label="Precio de 
oferta"),
                format="%(id)s")

And this is my controller:
def offers():
    linked_tables=['db.Offer']
    table = SQLFORM.smartgrid(db.OffersCity, linked_tables=linked_tables) 
    return dict(table=table)

 As you can see it's very simple.


On Tuesday, May 7, 2013 3:46:30 PM UTC+2, LightDot wrote:
>
> This is not your entire database definition, is it? It might help if you 
> post more of your code.
>
> Regards,
> Ales
>
> On Tuesday, May 7, 2013 3:36:52 PM UTC+2, José Manuel López wrote:
>>
>> Thank you Steve :), unfortunately it's no the error I've it ok in my code 
>> (maybe a problem while coping it here), 
>> Any other ideas?
>>
>> On Tuesday, May 7, 2013 1:46:43 PM UTC+2, 黄祥 wrote:
>>>
>>> it seems that you have a space on your table.
>>> table = SQLFORM.smartgrid(db. OffersCity, constraints=None) 
>>> should be
>>> table = SQLFORM.smartgrid(db.OffersCity, constraints=None)
>>>
>>> best regards
>>>
>>> On Tuesday, May 7, 2013 7:29:49 AM UTC-4, José Manuel López wrote:
>>>>
>>>> Hi, 
>>>> Lets say I have this table:
>>>> db.define_table('OffersCity', 
>>>>                 Field('city', db.City), 
>>>>                 Field('offer', db.Offer),
>>>>                 Field('hotel', db.Hotel))
>>>>
>>>> I want to create a smartgrid, but it's not working... I don't know why: 
>>>> Here it's my code:
>>>> table = SQLFORM.smartgrid(db. OffersCity, constraints=None) 
>>>> And this is the error given: 
>>>> Query Not Supported: invalid filter: __key__ filter value must be a Key
>>>> ; received None (a NoneType)
>>>> I'm on Google App Engine.
>>>> Kind Regards,
>>>> Jose M 
>>>>
>>>>
>>>>
>>>>

-- 

--- 
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