Implement use of the injected 'resolved_object' variable to simplify navigation links of objects in lists. Remove obsolete varaibles_tags. Consolidate get_action_links by means of get_menus_links which supports a list of menus to resolve. Remove obsolete 'list_object_variable_name'. Remove 'resolve_for_source' method which was consolidated with the normal resolve method by means of an optional 'source' argument.
This commit is contained in:
@@ -23,7 +23,7 @@ class SmartLinkConditionForm(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SmartLinkConditionForm, self).__init__(*args, **kwargs)
|
||||
self.fields['foreign_document_data'] = forms.ChoiceField(choices=ModelAttribute.get_choices_for(Document, type_names=['field', 'query']), label=_('Foreign document attribute'))
|
||||
self.fields['expression'].help_text = ' '.join([self.fields['expression'].help_text, ModelAttribute.help_text_for(Document, type_names=['field', 'related', 'property'])])
|
||||
self.fields['expression'].help_text = ' '.join([unicode(self.fields['expression'].help_text), ModelAttribute.help_text_for(Document, type_names=['field', 'related', 'property'])])
|
||||
|
||||
class Meta:
|
||||
model = SmartLinkCondition
|
||||
|
||||
@@ -13,8 +13,8 @@ from .permissions import (
|
||||
|
||||
link_smart_link_acl_list = Link(permissions=[ACLS_VIEW_ACL], text=_('ACLs'), view='linking:smart_link_acl_list', args='object.pk')
|
||||
link_smart_link_condition_create = Link(permissions=[PERMISSION_SMART_LINK_EDIT], text=_('Create condition'), view='linking:smart_link_condition_create', args='object.pk')
|
||||
link_smart_link_condition_delete = Link(permissions=[PERMISSION_SMART_LINK_EDIT], text=_('Delete'), view='linking:smart_link_condition_delete', args='condition.pk')
|
||||
link_smart_link_condition_edit = Link(permissions=[PERMISSION_SMART_LINK_EDIT], text=_('Edit'), view='linking:smart_link_condition_edit', args='condition.pk')
|
||||
link_smart_link_condition_delete = Link(permissions=[PERMISSION_SMART_LINK_EDIT], text=_('Delete'), view='linking:smart_link_condition_delete', args='resolved_object.pk')
|
||||
link_smart_link_condition_edit = Link(permissions=[PERMISSION_SMART_LINK_EDIT], text=_('Edit'), view='linking:smart_link_condition_edit', args='resolved_object.pk')
|
||||
link_smart_link_condition_list = Link(permissions=[PERMISSION_SMART_LINK_EDIT], text=_('Conditions'), view='linking:smart_link_condition_list', args='object.pk')
|
||||
link_smart_link_create = Link(permissions=[PERMISSION_SMART_LINK_CREATE], text=_('Create new smart link'), view='linking:smart_link_create')
|
||||
link_smart_link_delete = Link(permissions=[PERMISSION_SMART_LINK_DELETE], text=_('Delete'), view='linking:smart_link_delete', args='object.pk')
|
||||
|
||||
@@ -117,7 +117,6 @@ def smart_link_list(request):
|
||||
{'name': _('Enabled'), 'attribute': encapsulate(lambda x: two_state_template(x.enabled))},
|
||||
],
|
||||
'hide_link': True,
|
||||
'list_object_variable_name': 'smart_link',
|
||||
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@@ -234,7 +233,6 @@ def smart_link_condition_list(request, smart_link_pk):
|
||||
],
|
||||
'hide_link': True,
|
||||
'object': smart_link,
|
||||
'list_object_variable_name': 'condition',
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user