Skip to content

Commit

Permalink
models modified for the version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
deshraj committed Oct 10, 2015
1 parent edc1b69 commit 993e876
Show file tree
Hide file tree
Showing 2 changed files with 267 additions and 13 deletions.
254 changes: 254 additions & 0 deletions feeds/migrations/0016_auto_20151010_2149.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('feeds', '0015_auto_20150718_0618'),
]

operations = [
migrations.CreateModel(
name='BookmarkedNotice',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
],
),
migrations.RemoveField(
model_name='faculty',
name='bookmarks',
),
migrations.RemoveField(
model_name='notice',
name='details',
),
migrations.RemoveField(
model_name='student',
name='bookmarks',
),
migrations.AddField(
model_name='faculty',
name='academics_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='faculty',
name='administration_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='faculty',
name='events_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='faculty',
name='misc_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='faculty',
name='relevent_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='faculty',
name='tnp_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='notice',
name='btech',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='ce',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='cs',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='ece',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='ee',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='eee',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='first_year',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='fourth_year',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='ic',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='it',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='mba',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='mca',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='me',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='mt',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='mtech',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='other_course',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='second_year',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='notice',
name='subject',
field=models.CharField(default=None, max_length=200),
),
migrations.AddField(
model_name='notice',
name='third_year',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='student',
name='academics_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='student',
name='administration_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='student',
name='events_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='student',
name='misc_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='student',
name='relevent_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AddField(
model_name='student',
name='tnp_last_seen',
field=models.DateTimeField(default=None),
),
migrations.AlterField(
model_name='faculty',
name='address',
field=models.CharField(max_length=500, null=True),
),
migrations.AlterField(
model_name='faculty',
name='alternate_email',
field=models.EmailField(max_length=254, null=True),
),
migrations.AlterField(
model_name='faculty',
name='department',
field=models.CharField(max_length=100, null=True),
),
migrations.AlterField(
model_name='faculty',
name='designation',
field=models.CharField(max_length=100, null=True),
),
migrations.AlterField(
model_name='faculty',
name='ph_no',
field=models.PositiveIntegerField(null=True),
),
migrations.AlterField(
model_name='notice',
name='file_attached',
field=models.FileField(null=True, upload_to=b'attachments', blank=True),
),
migrations.AlterField(
model_name='notice',
name='owner',
field=models.ForeignKey(related_name='notices', default=None, to='feeds.Faculty'),
),
migrations.AlterField(
model_name='student',
name='address',
field=models.CharField(max_length=500, null=True),
),
migrations.AlterField(
model_name='student',
name='father_name',
field=models.CharField(max_length=200, null=True),
),
migrations.AlterField(
model_name='student',
name='mother_name',
field=models.CharField(max_length=200, null=True),
),
migrations.AlterField(
model_name='student',
name='ph_no',
field=models.PositiveIntegerField(null=True),
),
migrations.AddField(
model_name='bookmarkednotice',
name='notice',
field=models.ForeignKey(to='feeds.Notice'),
),
migrations.AddField(
model_name='bookmarkednotice',
name='user',
field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
),
]
26 changes: 13 additions & 13 deletions feeds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class Student(models.Model):
father_name = models.CharField(max_length = 200, null = True)
mother_name = models.CharField(max_length = 200, null = True)
address = models.CharField(max_length = 500, null = True)
relevent_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
academics_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
administration_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
misc_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
tnp_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
events_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
relevent_last_seen = models.DateTimeField(default = None,editable = True)
academics_last_seen = models.DateTimeField(default = None,editable = True)
administration_last_seen = models.DateTimeField(default = None,editable = True)
misc_last_seen = models.DateTimeField(default = None,editable = True)
tnp_last_seen = models.DateTimeField(default = None,editable = True)
events_last_seen = models.DateTimeField(default = None,editable = True)
course = models.CharField(max_length = 3,
choices = COURSE,
default = BTech)
Expand Down Expand Up @@ -79,12 +79,12 @@ class Faculty(models.Model):
ph_no = models.PositiveIntegerField(null = True)
address = models.CharField(max_length = 500, null = True)
alternate_email = models.EmailField(max_length = 254, null = True)
relevent_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
academics_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
administration_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
misc_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
tnp_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
events_last_seen = models.DateTimeField(auto_now_add=True,editable = True)
relevent_last_seen = models.DateTimeField(default = None,editable = True)
academics_last_seen = models.DateTimeField(editable = True, default = None)
administration_last_seen = models.DateTimeField(default = None,editable = True)
misc_last_seen = models.DateTimeField(default = None,editable = True)
tnp_last_seen = models.DateTimeField(default = None,editable = True)
events_last_seen = models.DateTimeField(default = None,editable = True)
@property
def relevent(self):
count = Notice.objects.filter(created_at__gt = self.relevent_last_seen, category = 'Relevent').count()
Expand Down Expand Up @@ -137,7 +137,7 @@ class Notice(models.Model):
file_attached = models.FileField(upload_to = "attachments", blank = True, null = True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now_add=True,editable = True)
subject = models.CharField(max_length = 200)
subject = models.CharField(max_length = 200, default = None)
category = models.CharField(max_length = 4,
choices = CATEGORY,
default = MISC)
Expand Down

0 comments on commit 993e876

Please sign in to comment.