From 9ee6b718da32f9a8c12946684bf73d55b20476f1 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 21 Dec 2014 15:02:34 +0100 Subject: [PATCH] Some issues with unique restraint when re-saving objects. --- src/typeclasses/models.py | 7 +++---- src/utils/idmapper/base.py | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/typeclasses/models.py b/src/typeclasses/models.py index ed077006c..8e7f3b45d 100644 --- a/src/typeclasses/models.py +++ b/src/typeclasses/models.py @@ -775,13 +775,12 @@ class TypeclassBase(SharedMemoryModelBase): attrs["path"] = "%s.%s" % (attrs["__module__"], name) # typeclass proxy setup - if "Meta" in attrs: - attrs["Meta"].proxy = True - else: + if not "Meta" in attrs: class Meta: proxy = True attrs["Meta"] = Meta - + attrs["Meta"].proxy = True + attrs["Meta"].app_label = attrs["path"] # patch start - django multi-inheritance # this is a copy of django.db.models.base.__new__ diff --git a/src/utils/idmapper/base.py b/src/utils/idmapper/base.py index c67fb218a..a0931962e 100755 --- a/src/utils/idmapper/base.py +++ b/src/utils/idmapper/base.py @@ -82,8 +82,8 @@ class SharedMemoryModelBase(ModelBase): document this auto-wrapping in the class header, this could seem very much like magic to the user otherwise. """ - #attrs["typename"] = cls.__name__ - #attrs["path"] = "%s.%s" % (attrs["__module__"], name) + attrs["typename"] = cls.__name__ + attrs["path"] = "%s.%s" % (attrs["__module__"], name) # set up the typeclass handling only if a variable _is_typeclass is set on the class def create_wrapper(cls, fieldname, wrappername, editable=True, foreignkey=False):