When I switch the db.table order around, smartgrid doesn’t work correctly.
- *Party* – Parent table. Can be person or organization.
- *auth_user* – holds person data
- *AddressIntersection* – Links 1:M to addresses to Parties
- *Address* – table of addresses
All together they work like this: (db.auth_user.partyID==db.Party.id) &
(db.PartyAddressIntersection.partyID==db.Party.id) &
(db.Address.id==db.PartyAddressIntersection.addressID)
This below works. Notice that db.Party is the main table, but I want
auth_user to be the main table because I want to only have people addresses
edited/viewed/deleted, not all Parties which include organizations.
def manage_party_addresses():
grid = SQLFORM.smartgrid(db.Party, linked_tables=['auth_user',
'PartyAddressIntersection','Address']),
return dict(grid=grid)
This below has the exact same tables, but with auth_user as the main table.
def manage_persons():
grid = SQLFORM.smartgrid(db.auth_user, linked_tables=['Party',
'PartyAddressIntersection','Address']),
return dict(grid=grid)
It displays the wrong child links which have no data in them:
Addresses(created_by)<http://127.0.0.1:8000/newCEA1/default/manage_persons/auth_user/Address.created_by/24?_signature=0d6e1f03fc199b9163759e40be90eaaed83f49f5>
Addresses(modified_by)<http://127.0.0.1:8000/newCEA1/default/manage_persons/auth_user/Address.modified_by/24?_signature=6e40a47ff2438d22c2098a5564f7ad26224ab65d>
Parties(created_by)<http://127.0.0.1:8000/newCEA1/default/manage_persons/auth_user/Party.created_by/24?_signature=ff88d1f8b0bf949b4197b409e2086c9cf2c9fdb8>
Parties(modified_by)<http://127.0.0.1:8000/newCEA1/default/manage_persons/auth_user/Party.modified_by/24?_signature=0fb06f77a28ee38f23bfee156dd26512015c2e78>
Partyaddressintersections(created_by)<http://127.0.0.1:8000/newCEA1/default/manage_persons/auth_user/PartyAddressIntersection.created_by/24?_signature=c81d60f35d8391cc2794c2c98197c40a1b5c0976>
Partyaddressintersections(modified_by)<http://127.0.0.1:8000/newCEA1/default/manage_persons/auth_user/PartyAddressIntersection.modified_by/24?_signature=57b1bcb15483a797f498bd9498c8b15b94c17fdb>
Any info on smartgrid table selection would be appreciated.
Thanks,
Alex Glaros
--
---
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.