Permalink
Browse files

Add new attribute to set the name for automatic resources

  • Loading branch information...
william-gr committed Sep 11, 2013
1 parent 95b39aa commit 1f0687e481025d0ccba7bf238b89a69d784efbde
Showing with 9 additions and 3 deletions.
  1. +9 −3 gui/freeadmin/options.py
View
@@ -66,6 +66,7 @@ class BaseFreeAdmin(object):
exclude_fields = ('id', )
resource = None
resource_mixin = None
+ resource_name = None
double_click = True
advanced_fields = []
@@ -135,12 +136,17 @@ def get_urls(self):
)
from freenasUI.freeadmin.navtree import navtree
if self.resource is None and self._model:
- myArgs = dict(
- queryset=self._model.objects.all(),
- resource_name="%s/%s" % (
+ if self.resource_name is not None:
+ resource_name=self.resource_name
+ else:
+ resource_name='%s/%s' % (
self.app_label,
self.module_name,
),
+
+ myArgs = dict(
+ queryset=self._model.objects.all(),
+ resource_name=resource_name,
include_resource_uri=False,
always_return_data=True,
paginator_class=DojoPaginator,

0 comments on commit 1f0687e

Please sign in to comment.