Reputation: 14505
Im a newbie to Python, I need to add a extra column of data Django's auth_group table ( using Mysql db) . Since it's a built in model, I can't just add a column. Is there a way to extend it?
Upvotes: 1
Views: 1472
Reputation: 136
use add_to_class method. Add a new field named created_at, in one of you models.py, add this code
from django.contrib.auth.models import Group
Group.add_to_class('created_at', models.DateTimeField(auto_now_add=True))
Upvotes: 4