Форум сайта python.su
Добрый день имею модель профайла auth_user
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
# This is the only required field
user = models.ForeignKey(User, unique=True)
# The rest is completely up to you...
avatar = models.ImageField(upload_to='static', verbose_name=(u'Фото'), null=True, blank=True,)
birthday = models.DateField(verbose_name=(u'Дата рождения'), null=True, blank=True,)
UserProfileFormSet = inlineformset_factory(User, UserProfile, can_delete=False)
formset = UserProfileFormSet(instance=user)
Офлайн