Skip to content

Commit

Permalink
more modeling
Browse files Browse the repository at this point in the history
  • Loading branch information
jhwj9617 committed Mar 29, 2015
1 parent 84484f2 commit e0d904e
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 6 deletions.
74 changes: 74 additions & 0 deletions mukmuks/myproject/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
]

operations = [
migrations.CreateModel(
name='Attribute',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('name', models.CharField(max_length=200)),
('score', models.DecimalField(decimal_places=1, max_digits=2)),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Penis',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('name', models.CharField(max_length=200)),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='RatedModel',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('name', models.CharField(max_length=200)),
('publish_date', models.DateField(max_length=200)),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='RatedObject',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('name', models.CharField(max_length=200)),
('publish_date', models.DateField(max_length=200)),
('rated_model', models.ForeignKey(to='myproject.RatedModel')),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('name', models.CharField(max_length=200)),
('publish_date', models.DateField(max_length=200)),
],
options={
},
bases=(models.Model,),
),
migrations.AddField(
model_name='attribute',
name='rated_model',
field=models.ForeignKey(to='myproject.RatedModel'),
preserve_default=True,
),
]
28 changes: 28 additions & 0 deletions mukmuks/myproject/migrations/0002_auto_20150328_2023.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('myproject', '0001_initial'),
]

operations = [
migrations.RemoveField(
model_name='attribute',
name='rated_model',
),
migrations.DeleteModel(
name='Attribute',
),
migrations.RemoveField(
model_name='ratedobject',
name='rated_model',
),
migrations.DeleteModel(
name='RatedObject',
),
]
38 changes: 38 additions & 0 deletions mukmuks/myproject/migrations/0003_attribute_ratedobject.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('myproject', '0002_auto_20150328_2023'),
]

operations = [
migrations.CreateModel(
name='Attribute',
fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)),
('name', models.CharField(max_length=200)),
('score', models.DecimalField(max_digits=2, decimal_places=1)),
('rated_model', models.ForeignKey(to='myproject.RatedModel')),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='RatedObject',
fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)),
('name', models.CharField(max_length=200)),
('publish_date', models.DateField(max_length=200)),
('rated_model', models.ForeignKey(to='myproject.RatedModel')),
],
options={
},
bases=(models.Model,),
),
]
17 changes: 17 additions & 0 deletions mukmuks/myproject/migrations/0004_delete_penis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('myproject', '0003_attribute_ratedobject'),
]

operations = [
migrations.DeleteModel(
name='Penis',
),
]
22 changes: 22 additions & 0 deletions mukmuks/myproject/migrations/0005_auto_20150329_0040.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('myproject', '0004_delete_penis'),
]

operations = [
migrations.RemoveField(
model_name='attribute',
name='rated_model',
),
migrations.RemoveField(
model_name='ratedobject',
name='rated_model',
),
]
26 changes: 26 additions & 0 deletions mukmuks/myproject/migrations/0006_auto_20150329_0043.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('myproject', '0005_auto_20150329_0040'),
]

operations = [
migrations.AddField(
model_name='attribute',
name='rated_model',
field=models.ForeignKey(to='myproject.RatedModel', null=True),
preserve_default=True,
),
migrations.AddField(
model_name='ratedobject',
name='rated_model',
field=models.ForeignKey(to='myproject.RatedModel', null=True),
preserve_default=True,
),
]
Empty file.
12 changes: 6 additions & 6 deletions mukmuks/myproject/models/ratedmodel.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from django.db import models

# Create your models here.
class RatedModel(models.Model):
name = models.CharField(max_length=200)
publish_date = models.DateField(max_length=200)

class Attribute(models.Model):
name = models.CharField(max_length=200)
score = models.DecimalField(max_digits=2, decimal_places=1)
rated_model = models.ForeignKey(RatedModel, null=True)

class RatedObject(models.Model):
name = models.CharField(max_length=200)
publish_date = models.DateField(max_length=200)

class RatedModel(models.Model):
name = models.CharField(max_length=200)
publish_date = models.DateField(max_length=200)
attributes = models.ForeignKey(Attribute, blank=True, null=True)
rated_objects = models.ForeignKey(RatedObject, blank=True, null=True)
rated_model = models.ForeignKey(RatedModel, null=True)

0 comments on commit e0d904e

Please sign in to comment.