mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-04-24 21:04:43 +00:00
Fix "MonitorField requires a "monitor" argument"
This commit is contained in:
parent
f02b0912b2
commit
db5e1f99fc
1 changed files with 8 additions and 0 deletions
|
|
@ -113,6 +113,14 @@ class MonitorField(models.DateTimeField):
|
|||
self._save_initial(model_instance.__class__, model_instance)
|
||||
return super(MonitorField, self).pre_save(model_instance, add)
|
||||
|
||||
def deconstruct(self):
|
||||
name, path, args, kwargs = super(MonitorField, self).deconstruct()
|
||||
if self.monitor is not None:
|
||||
kwargs['monitor'] = self.monitor
|
||||
if self.when is not None:
|
||||
kwargs['when'] = self.when
|
||||
return name, path, args, kwargs
|
||||
|
||||
|
||||
SPLIT_MARKER = getattr(settings, 'SPLIT_MARKER', '<!-- split -->')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue