コード例 #1
0
    def process(self, obj):
        set_defaults(obj, **self.get_excluded_field_defaults())
        obj = self.save()

        defaults = self.get_excluded_m2m_field_defaults()
        for key, values in defaults:
            manager = getattr(obj, key)
            manager.set(values, clear=True)

        return obj
コード例 #2
0
    def process(self, obj):
        set_defaults(obj, **self.get_excluded_field_defaults())
        obj = self.save()

        defaults = self.get_excluded_m2m_field_defaults()
        for key, values in defaults:
            manager = getattr(obj, key)
            manager.set(values, clear=True)

        return obj