def attribute_post_save(sender, instance, created, **kwargs): entity = instance.schema.get_entity(regenerate = True) if hasattr(instance, '_old_slug'): db.rename_column(entity, instance._old_slug, instance.slug) del instance._old_slug db.add_necessary_columns(entity) registry.cache.set(entity._meta.app_label, entity._meta.object_name) signals.dynamic_model_changed.send(sender, entity=entity)
def iter_models(self, *schemas): schemas = schemas or self._registry for schema in schemas: for s in schema.objects.all(): db.add_necessary_columns(s.entity) yield s.entity