I have a Wagtail model that extends the base Page model:
models.py
class EmployeePage(Page):
eid = models.PositiveIntegerField(unique=True)
active = models.BooleanField(blank=True)
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
...
content_panels = [
FieldPanel('eid'),
FieldPanel('first_name'),
FieldPanel('last_name'),
]
I am only updating the active
field directly to the live model via daily API import script, so I want it excluded from the CMS entirely.
import_script.py
employee = EmployeePage.objects.get(eid=imported_row.eid)
employee.active = imported_row.active
employee.save()
I'm able to exclude the active
field from the CMS edit view by not including it in the content_panels
above, but this appears to just be cosmetic as a value is still always included in page revisions, which is overriding my imported value. How can I have a field that is excluded from page revisions?