Browse Source

perf: 修改 m2m field

pull/10327/head
ibuler 2 years ago
parent
commit
20b7b794d8
  1. 6
      apps/common/db/fields.py

6
apps/common/db/fields.py

@ -289,16 +289,10 @@ class RelatedManager:
self.field = field
self.value = None
def _is_value_stale(self, current_value):
return self.value != current_value
def set(self, value):
self.value = value
self.instance.__dict__[self.field.name] = value
def serialize(self):
return self.value
def _get_queryset(self):
model = apps.get_model(self.field.to)
value = self.value

Loading…
Cancel
Save