added parent links
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.9.5-trunk+timestamp.2014.07.03.11.54.34
|
Version 2.9.5-trunk+timestamp.2014.07.03.12.21.52
|
||||||
|
|||||||
+20
-10
@@ -74,16 +74,26 @@ class Collection(object):
|
|||||||
href = URL(args=field._tablename,scheme=True)+'?%s={id}' % field.name
|
href = URL(args=field._tablename,scheme=True)+'?%s={id}' % field.name
|
||||||
links.append({'rel':'current','href':href,'prompt':str(field),
|
links.append({'rel':'current','href':href,'prompt':str(field),
|
||||||
'type':'children'})
|
'type':'children'})
|
||||||
fields = self.table_policy.get('fields', table.fields)
|
if row:
|
||||||
for fieldname in fields:
|
fields = self.table_policy.get('fields', table.fields)
|
||||||
field = table[fieldname]
|
for fieldname in fields:
|
||||||
if field.type=='upload' and row[fieldname]:
|
field = table[fieldname]
|
||||||
href = URL('download',args=row[fieldname],scheme=True)
|
if field.type.startswith('reference '):
|
||||||
links.append({'rel':'current','href':href,'prompt':str(field),
|
href = URL(args=field.type[10:],vars={'id':row[fieldname]},
|
||||||
'type':'attachment'})
|
scheme=True)
|
||||||
# should this be supported?
|
links.append({'rel':'current','href':href,'prompt':str(field),
|
||||||
for rel,build in (self.table_policy.get('links',{}).items()):
|
'type':'parent'})
|
||||||
links.append({'rel':'current','href':build(row),'prompt':rel})
|
|
||||||
|
for fieldname in fields:
|
||||||
|
field = table[fieldname]
|
||||||
|
if field.type=='upload' and row[fieldname]:
|
||||||
|
href = URL('download',args=row[fieldname],scheme=True)
|
||||||
|
links.append({'rel':'current','href':href,'prompt':str(field),
|
||||||
|
'type':'attachment'})
|
||||||
|
|
||||||
|
# should this be supported?
|
||||||
|
for rel,build in (self.table_policy.get('links',{}).items()):
|
||||||
|
links.append({'rel':'current','href':build(row),'prompt':rel})
|
||||||
# not sure
|
# not sure
|
||||||
return links
|
return links
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user