1. Lynn Rees
  2. graphalchemy

Commits

Lynn Rees  committed ed661b8

- fix that

  • Participants
  • Parent commits 6f7eb43
  • Branches pu

Comments (0)

Files changed (1)

File graphalchemy/models/elements.py

View file
  • Ignore whitespace
     def L(self):
         '''local settings'''
         class_names = self.names
-        metas = dict(
+        return self.M.localize(
+            self,
             # properties to index
             indexed=set(k for k in class_names(indexed=True)),
             # properties indexed for full text search
             escaped=set(k for k in class_names(escaped=True)),
             # model name
             name=selfname(self),
+            # slug field
+            slug_from=next(class_names(slug_from=True), ''),
         )
-        # slug field
-        try:
-            metas['slug_from'] = class_names(slug_from=True)[0]
-        except IndexError:
-            metas['slug_from'] = ''
-        return self.M.localize(self, metas)
 
     def _version(self):
         '''increment current snapshot number of node'''