Commits

Richard Gerkin committed 5e25420

Updated admin

Comments (0)

Files changed (1)

         return GenericInline
     meta = model._meta
     related_models = [x.model for x in model._meta.get_all_related_objects()]
-    print model.__name__,related_models
     inlines = [get_inline(x) for x in related_models]
     return inlines
      
 def get_admin(model):
     class GenericModelAdmin(admin.ModelAdmin):
         meta = model._meta
-        fields = [x.name for x in meta.fields+meta.many_to_many if x.name not in ['id','date']]
+        fields = [x.name for x in meta.fields+meta.many_to_many \
+                         if x.name not in ['id','date']]
         displayable_fields = [x.name for x in meta.fields]
         if model.__bases__[0].__name__ == 'Name':
             meta = m.Name._meta
-            fields += [x.name for x in meta.fields if x.name != 'id' and x.name not in fields]
+            fields += [x.name for x in meta.fields if x.name != 'id' \
+                              and x.name not in fields]
         inlines = get_inlines(model)
         list_display = displayable_fields
         list_editable = [field for field in displayable_fields \