Both
2.4.6-stable+timestamp.2013.04.06.17.37.38 
and
2.6.0-development+timestamp.2013.08.09.11.04.59

On Friday, August 9, 2013 2:39:49 AM UTC-5, Massimo Di Pierro wrote:
>
> Which web2py version?
>
> On Thursday, 8 August 2013 16:27:35 UTC-5, Kyle Flanagan wrote:
>>
>> I submitted this as a ticket (1622), but it may be more appropriate to be 
>> addressed here.
>>
>>
>> What steps will reproduce the problem?
>> 1. Open the attached app (named poc), login using [email protected], pw: 
>> testme
>> 2. View the default index
>> 3. Sort by "Store Id" by clicking on the header
>> 4. Click on "Edit"
>> What is the expected output? What do you see instead?
>> One would expect that the record being edited would be from the db.inventory 
>> table, but instead the record being edited is from the db.item table. 
>> (...field_id=db.inventory.id,...) is specified in the controller and is 
>> enforced without any sorting. However, sorting on a header not from the 
>> db.inventory table causes this to no longer be the case.
>> What version of the product are you using? On what operating system?
>> 2.4.6-stable+timestamp.2013.04.06.17.37.38
>> PythonAnywhere (Linux hansel-liveconsole 3.8.0-19-generic #30-Ubuntu SMP Wed 
>> May 1 16:35:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux)
>> Please provide any additional information below.
>> The db schema in the attached sample is not well defined, but was just 
>> created to illustrate the issue. An item is defined as an entity that 
>> belongs to a shelf and a store. An inventory record is the count of how much 
>> of an item is in stock. 
>>
>> Some pertinent code excerpts:
>>
>> ----------------------------------------------------------------------
>> From db.py:
>> ----------------------------------------------------------------------
>>
>> db.define_table('store',
>>     Field('name', 'string', required=True),
>>     Field('state_name', 'string', required=True),
>>     format = '%(name)s')
>>
>> db.define_table('shelf',
>>     Field('name', 'string', required=True),
>>     format = '%(name)s')    
>>     
>> db.define_table('item',
>>     Field('name', 'string', required=True),
>>     Field('store_id', db.store, required=True),
>>     Field('shelf_id', db.shelf, required=True),
>>     Field('description', 'string', required=True),
>>     format = '%(name)s')
>>     
>> db.define_table('inventory',
>>     Field('item_id', db.item, required=True),
>>     Field('in_stock', 'integer', required=True))
>>
>> ----------------------------------------------------------------------
>> From default.py:
>> ----------------------------------------------------------------------
>>
>> @auth.requires_login()
>> def index():
>>     """
>>
>>     """    
>>     query = (db.inventory.item_id == db.item.id)
>>     
>>     fields = [
>>                 db.inventory.item_id,
>>                 db.item.shelf_id, 
>>                 db.inventory.in_stock,
>>                 db.item.name,
>>                 db.item.store_id
>>                 ]
>>     
>>     grid = SQLFORM.grid(query=query, create=True, field_id=db.inventory.id, 
>> editable=True, fields=fields)
>>     
>>     return dict(grid=grid)
>>
>>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to