Skip to content

Commit

Permalink
Add new attribute to set the name for automatic resources
Browse files Browse the repository at this point in the history
  • Loading branch information
william-gr committed Sep 11, 2013
1 parent 95b39aa commit 1f0687e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions gui/freeadmin/options.py
Expand Up @@ -66,6 +66,7 @@ class BaseFreeAdmin(object):
exclude_fields = ('id', )
resource = None
resource_mixin = None
resource_name = None
double_click = True

advanced_fields = []
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1f0687e

Please sign in to comment.