Modify ↓
Ticket #693 (closed enhancement: fixed)
Introspection plugin for Django Audit Log
| Reported by: | Rick.van.Hattem@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 1.0 |
| Component: | commands | Version: | unknown |
| Keywords: | Cc: |
Description
Since this came by at a StackOverflow? question I thought it might be nice to add the introspection plugin to South :)
Django Audit Log uses a custom field to store the current user, it's trivial to implement but might confuse some users.
Link to the field: http://code.google.com/p/django-audit-log/source/browse/audit_log/models/fields.py
The StackOverflow? question: http://stackoverflow.com/questions/4475377/django-south-with-django-audit-log/
The proposed plugin:
"""
South introspection rules for django-audit-log
"""
from south.modelsinspector import add_introspection_rules
try:
# Try and import the field so we can see if audit_log is available
from audit_log.models import fields
# Make sure the `to` and `null` parameters will be ignored
rules = [(
(fields.LastUserField,),
[],
{
'to': ['rel.to', {'default': User}],
'null': ['null', {'default': True}],
},
)]
# Add the rules for the `LastUserField`
add_introspection_rules(
rules,
['^audit_log\.models\.fields\.LastUserField'],
)
except ImportError:
pass
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Fixed in [abd220673d79].