Browse Source

Merge branch 'newlodel' of git.labocleo.org:lodel2 into newlodel

prieto 8 years ago
parent
commit
2c36c7d46e
2 changed files with 3 additions and 4 deletions
  1. 0
    2
      lodel/editorial_model/components.py
  2. 3
    2
      tests/editorial_model/test_model.py

+ 0
- 2
lodel/editorial_model/components.py View File

132
     # @todo use Settings.editorialmodel.groups to determine wich fields should be returned
132
     # @todo use Settings.editorialmodel.groups to determine wich fields should be returned
133
     def fields(self, uid = None, no_parents = False):
133
     def fields(self, uid = None, no_parents = False):
134
         fields = self.__fields if no_parents else self.__all_fields
134
         fields = self.__fields if no_parents else self.__all_fields
135
-        if CLASS_ID_FIELDNAME in fields:
136
-            del(fields[CLASS_ID_FIELDNAME])
137
         try:
135
         try:
138
             return list(fields.values()) if uid is None else fields[uid]
136
             return list(fields.values()) if uid is None else fields[uid]
139
         except KeyError:
137
         except KeyError:

+ 3
- 2
tests/editorial_model/test_model.py View File

74
         cls.new_field('name', data_handler = 'varchar')
74
         cls.new_field('name', data_handler = 'varchar')
75
         cls.new_field('string', data_handler = 'varchar')
75
         cls.new_field('string', data_handler = 'varchar')
76
         cls.new_field('lodel_id', data_handler = 'varchar')
76
         cls.new_field('lodel_id', data_handler = 'varchar')
77
+        #Automatic field added
77
 
78
 
78
         fields = cls.fields()
79
         fields = cls.fields()
79
-        self.assertEqual(len(fields), 3)
80
+        self.assertEqual(len(fields), 4)
80
         self.assertEqual(
81
         self.assertEqual(
81
             set([f.uid for f in fields]),
82
             set([f.uid for f in fields]),
82
-            set(['name', 'string', 'lodel_id'])
83
+            set(['name', 'string', 'lodel_id', 'classname'])
83
         )
84
         )
84
 
85
 
85
     def test_d_hash(self):
86
     def test_d_hash(self):

Loading…
Cancel
Save