Changes between Version 1 and Version 2 of Ticket #27149
- Timestamp:
- Aug 30, 2016, 2:18:05 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27149 – Description
v1 v2 2 2 3 3 {{{ 4 APP_LABEL = os.path.basename(os.path.dirname(__file__)) 4 5 def generic_rel_filter(model, target, column, id): 5 6 return model.objects.extra(where=[''' … … 7 8 from {app_label}_{target} 8 9 where content_type_id = (select id from django_content_type where model = '{model}') 9 and {column} = {id})'''.format(app_label= os.path.basename(os.path.dirname(__file__)), model=model.__name__.lower(), target=target, column=column, id=id)])10 and {column} = {id})'''.format(app_label=APP_LABEL, model=model.__name__.lower(), target=target, column=column, id=id)]) 10 11 }}} 11 12