From c3468c1be5ed5eec461ca25ed4b584333f471029 Mon Sep 17 00:00:00 2001 From: ailsoncgt Date: Wed, 12 Oct 2016 14:31:12 -0300 Subject: [PATCH] Myme Types model #132 --- core/migrations/0002_mymetype.py | 27 +++++++++++++++++++++++++++ core/models.py | 14 ++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-) create mode 100644 core/migrations/0002_mymetype.py diff --git a/core/migrations/0002_mymetype.py b/core/migrations/0002_mymetype.py new file mode 100644 index 0000000..a813883 --- /dev/null +++ b/core/migrations/0002_mymetype.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10 on 2016-10-12 17:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='MymeType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('typ', models.CharField(max_length=100, unique=True, verbose_name='Type')), + ('icon', models.CharField(max_length=50, unique=True, verbose_name='Icon')), + ], + options={ + 'verbose_name_plural': 'Amadeus Myme Types', + 'verbose_name': 'Amadeus Myme Type', + }, + ), + ] diff --git a/core/models.py b/core/models.py index 7ebc87f..be62b25 100644 --- a/core/models.py +++ b/core/models.py @@ -4,6 +4,20 @@ from users.models import User from autoslug.fields import AutoSlugField # Create your models here. +class MymeType(models.Model): + typ = models.CharField(_('Type'), max_length=100, unique=True) + icon = models.CharField(_('Icon'), max_length=50, unique=True) + + class Meta: + verbose_name= 'Amadeus Myme Type' + verbose_name_plural = 'Amadeus Myme Types' + + def get_icon(self, type): + pass + + def __str__(self): + return self.typ + class Action(models.Model): """ It represents an Action on the program by a User such as "create post", -- libgit2 0.21.2