Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
541375e
commit 23e8196
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Profile', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), | ||
('slug', models.SlugField(unique=True, max_length=30)), | ||
('about', models.TextField()), | ||
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
from django.conf import settings | ||
from django.db import models | ||
|
||
# Create your models here. | ||
|
||
class Profile(models.Model): | ||
user = models.OneToOneField( | ||
settings.AUTH_USER_MODEL) | ||
slug = models.SlugField( | ||
max_length=30, | ||
unique=True) | ||
about = models.TextField() | ||
|
||
def __str__(self): | ||
return self.user.get_username() |