- August 2, 2010
- Not specified
- 1 (after 7 ratings)
This code adds new field to Django user model. It must be executed early as much as possible, so put this code to init.py of some application.
1 2 3 4 5
from django.db import models from django.contrib.auth.models import User some_field = models.CharField(max_length=32) some_field.contribute_to_class(User, 'some_field')