You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the history table name is hardcoded (APP_historicalMODEL).
This pull request add support for custom tables names by adding a
`db_history_table` option.
As Django reject all unknown option in `Meta` inner class, I've added an
`History` inner class to store this option (and possibly others future
options).
```
class Organization(models.Model):
name = models.CharField(_('Organization or Name'), max_length=25)
address = models.CharField(_('Address'), max_length=250)
zipcode = models.CharField(_('Postal code'), max_length=10, null=True)
city = models.CharField(_('City'), max_length=50)
country = models.CharField(_('Country'), max_length=2, \
choices=COUNTRIES_CHOICES)
def __str__(self):
return self.name
class History:
db_history_table = 'organizations_history'
class Meta:
db_table = 'organizations'
```
TODO: Documentation.
0 commit comments