Skip to content

Overriding the db_table attribute of event models #190

Answered by wesleykendall
stephan0h asked this question in Q&A
Discussion options

You must be logged in to vote

@stephan0h you can also pass meta to pghistory.track if you'd like to override Meta attributes of the event model. This may cut down on the code boilerplate of defining a custom event model:

@pghistory.track(meta={'db_table': 'my_custom_event_table_name'})
class MyTrackedModel(models.Model):
    pass

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@stephan0h
Comment options

Answer selected by wesleykendall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #189 on March 26, 2025 17:22.