class Profile(models.Model):
class Meta:
db_table = 'userprofile'
verbose_name = 'Профиль пользователя'
verbose_name_plural = 'Профиля пользователей'
profile = models.OneToOneField(User)
my_name = models.CharField(max_length=100, blank=True, verbose_name='Имя')
website = models.URLField(max_length=60, blank=True, verbose_name='Сайт')
picture = models.ImageField(upload_to='profile_users/%Y/%m/%d', blank=True, verbose_name='Картинка')
date_registr = models.DateTimeField(blank=True, null=True, verbose_name='Дата регистрации')
date_vhod = models.DateTimeField(auto_now=True, blank=True, null=True, verbose_name='Дата входа')
def __unicode__(self):
return self.my_name
db_table = 'userprofile'
profile = models.OneToOneField(User)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Profile',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('my_name', models.CharField(max_length=100, verbose_name=b'\xd0\x98\xd0\xbc\xd1\x8f', blank=True)),
('website', models.URLField(max_length=60, verbose_name=b'\xd0\xa1\xd0\xb0\xd0\xb9\xd1\x82', blank=True)),
('picture', models.ImageField(upload_to=b'profile_users/%Y/%m/%d', verbose_name=b'\xd0\x9a\xd0\xb0\xd1\x80\xd1\x82\xd0\xb8\xd0\xbd\xd0\xba\xd0\xb0', blank=True)),
('date_registr', models.DateTimeField(default=True, verbose_name=b'\xd0\x94\xd0\xb0\xd1\x82\xd0\xb0 \xd1\x80\xd0\xb5\xd0\xb3\xd0\xb8\xd1\x81\xd1\x82\xd1\x80\xd0\xb0\xd1\x86\xd0\xb8\xd0\xb8')),
('date_vhod', models.DateTimeField(auto_now=True, verbose_name=b'\xd0\x94\xd0\xb0\xd1\x82\xd0\xb0 \xd0\xb2\xd1\x85\xd0\xbe\xd0\xb4\xd0\xb0', null=True)),
('profile', models.OneToOneField(null=True, to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'userprofile',
'verbose_name': '\u041f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f',
'verbose_name_plural': '\u041f\u0440\u043e\u0444\u0438\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439',
},
),
]
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '',
'USER': '',
'PASSWORD': '',
'OPTIONS': {
"init_command": "SET storage_engine=MYISAM",
}
}
},