Commit c3468c1be5ed5eec461ca25ed4b584333f471029
1 parent
20e1e4db
Exists in
master
and in
5 other branches
Myme Types model #132
Showing
2 changed files
with
41 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2016-10-12 17:29 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +from django.db import migrations, models | ||
6 | + | ||
7 | + | ||
8 | +class Migration(migrations.Migration): | ||
9 | + | ||
10 | + dependencies = [ | ||
11 | + ('core', '0001_initial'), | ||
12 | + ] | ||
13 | + | ||
14 | + operations = [ | ||
15 | + migrations.CreateModel( | ||
16 | + name='MymeType', | ||
17 | + fields=[ | ||
18 | + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
19 | + ('typ', models.CharField(max_length=100, unique=True, verbose_name='Type')), | ||
20 | + ('icon', models.CharField(max_length=50, unique=True, verbose_name='Icon')), | ||
21 | + ], | ||
22 | + options={ | ||
23 | + 'verbose_name_plural': 'Amadeus Myme Types', | ||
24 | + 'verbose_name': 'Amadeus Myme Type', | ||
25 | + }, | ||
26 | + ), | ||
27 | + ] |
core/models.py
@@ -4,6 +4,20 @@ from users.models import User | @@ -4,6 +4,20 @@ from users.models import User | ||
4 | from autoslug.fields import AutoSlugField | 4 | from autoslug.fields import AutoSlugField |
5 | # Create your models here. | 5 | # Create your models here. |
6 | 6 | ||
7 | +class MymeType(models.Model): | ||
8 | + typ = models.CharField(_('Type'), max_length=100, unique=True) | ||
9 | + icon = models.CharField(_('Icon'), max_length=50, unique=True) | ||
10 | + | ||
11 | + class Meta: | ||
12 | + verbose_name= 'Amadeus Myme Type' | ||
13 | + verbose_name_plural = 'Amadeus Myme Types' | ||
14 | + | ||
15 | + def get_icon(self, type): | ||
16 | + pass | ||
17 | + | ||
18 | + def __str__(self): | ||
19 | + return self.typ | ||
20 | + | ||
7 | class Action(models.Model): | 21 | class Action(models.Model): |
8 | """ | 22 | """ |
9 | It represents an Action on the program by a User such as "create post", | 23 | It represents an Action on the program by a User such as "create post", |