Removed 1-form limit for new instance forms.
[philo.git] / contrib / gilbert / plugins / models.py
index ae97ee7..5bf2550 100644 (file)
@@ -65,7 +65,7 @@ class ModelAdmin(Plugin):
        def data_serialize_model_instance(cls, obj):
                return {
                        'app_label': obj._meta.app_label,
-                       'name': obj._meta.object_name,
+                       'name': obj._meta.module_name,
                        'pk': obj.pk,
                        '__unicode__': unicode(obj),
                }
@@ -120,6 +120,7 @@ class ModelAdmin(Plugin):
        @property
        def data_columns_spec(self):
                spec = []
+               
                for field_name in self.data_columns:
                        column = {
                                'dataIndex': field_name,
@@ -132,6 +133,8 @@ class ModelAdmin(Plugin):
                                column['sortable'] = True
                        if field_name in self.data_editable_columns:
                                column['editable'] = True
+                       if field_name in [field.name for field in self.model_meta.fields if isinstance(field.rel, ManyToOneRel)]:
+                               column['xtype'] = 'foreignkeycolumn'
                        spec.append(column)
                return spec