Skip to content

Instantly share code, notes, and snippets.

@arjunnambiartc
Last active August 29, 2015 14:01
Show Gist options
  • Save arjunnambiartc/526256f38c26b3426ded to your computer and use it in GitHub Desktop.
Save arjunnambiartc/526256f38c26b3426ded to your computer and use it in GitHub Desktop.
models.py for jericho
from django.db import models
from django.contrib.auth.models import User
class Sheet1(models.Model):
Name = models.CharField(max_length=100)
Year = models.SmallIntegerField(max_length=5)
Start_Date = models.DateField(help_text='in EST')
End_Date = models.DateField(help_text='in EST')
def __unicode__(self):
return self.Name
class Meta:
verbose_name = u"Change Sheet"
verbose_name_plural = verbose_name
class Change(models.Model):
Reference = models.SmallIntegerField(max_length=10, verbose_name='Ref')
Sheet = models.ForeignKey(Sheet1)
Task = models.SmallIntegerField(max_length=10, verbose_name='Task#', blank=True)
Ticket = models.CharField(max_length=50, verbose_name='Ticket#')
Tool_choices = ((1, 'TechDirect'), (2, 'Econnect'), (3, 'Roars'))
Tool = models.SmallIntegerField(choices=Tool_choices, default=1, max_length=1)
Date_of_Request = models.DateTimeField(help_text='in EST', verbose_name='Date of Request')
BDD = models.DateTimeField(help_text='in EST', verbose_name='Business Driven Date')
Assigned_group = models.CharField(max_length=20, verbose_name='Assigned Group')
Description = models.TextField(blank=True)
Impacted_users = models.TextField(blank=True, verbose_name='Impacted Users')
User_email_id = models.EmailField()
Impacted_region_choices = ((1, 'APAC'), (2, 'EMEA'), (3, 'AMRS'), (4, 'GLOBAL'), (5, 'PROXY-AMRS & LATAM'),
(6, 'PROXY-APAC'), (7, 'PROXY-EMEA'), (8, 'GDC-PROXY'))
Impacted_region_types = models.SmallIntegerField(choices=Impacted_region_choices, default=3, max_length=1,
verbose_name='Impacted Regions/Types')
Change_owner = models.ForeignKey(User, related_name='change_owner', verbose_name='Change Owner', null=True,
default='None', blank=True)
Change_ow_assgn_date = models.DateField(help_text='in EST', verbose_name='Change Owner Assigned Date', blank=True)
Change_designer = models.ForeignKey(User, related_name='change_designer', verbose_name='Change Designer',
null=True, default='none', blank=True)
Change_de_assgn_date = models.DateField(help_text='in EST', verbose_name='Change Designer Assigned Date',
blank=True)
User_req_choices = ((1, 'Yes'), (2, 'No'), (3, 'Not Applicable'))
User_req_comp = models.SmallIntegerField(choices=User_req_choices, verbose_name='User Request Complete?')
Date_inf_rec = models.DateTimeField(help_text='in EST', verbose_name='Date when Info Received', blank=True)
Device_impacted = models.TextField(verbose_name='Devices Impacted', blank=True)
Env_choices = ((0, '0-LAB'), (1, '1-DEV'), (2, '2-QA/TEST'), (3, '3-PREPROD'), (4, '4-CONTINGENCY'), (5, '5-PROD'))
Env = models.SmallIntegerField(choices=Env_choices, verbose_name='Environment')
Mon_comm = models.TextField(verbose_name='Monday Comms', blank=True)
Tue_comm = models.TextField(verbose_name='Tueday Comms', blank=True)
Wed_comm = models.TextField(verbose_name='Wednesday Comms', blank=True)
Thu_comm = models.TextField(verbose_name='Thursday Comms', blank=True)
Fri_comm = models.TextField(verbose_name='Friday Comms', blank=True)
Sat_comm = models.TextField(verbose_name='Saturday Comms', blank=True)
Sun_comm = models.TextField(verbose_name='Sunday Comms', blank=True)
RFC = models.CharField(max_length=50, verbose_name='RFC#', blank=True)
RFC_type_choices = ((1, 'Normal'), (2, 'Normal with EP'), (3, 'Standard'), (4, 'Urgent'), (5, 'Post Facto'))
RFC_type = models.SmallIntegerField(choices=RFC_type_choices, default=1, max_length=1, verbose_name='RFC Type')
RFC_status_choices = ((1, 'Initial'), (2, 'Pending Assessment'), (3, 'Pending Group Approvals'),
(4, 'Pending Final Approvals'), (5, 'Pending Implementation'), (6, 'Implemented'),
(7, 'Cancelled'), (8, 'Rejected'), (9, 'On Hold'), (10, 'No RFC Required'),
(11, 'Awaiting RFC details'))
RFC_status = models.SmallIntegerField(choices=RFC_status_choices, default=1, max_length=1,
verbose_name='RFC Status')
Risk_choices = ((1, 'Low'), (2, 'High'))
Risk = models.SmallIntegerField(choices=Risk_choices, default=1, max_length=1)
Corp_env_choices = ((1, 'LBAC'), (2, 'LMER'))
Corp_env = models.SmallIntegerField(choices=Corp_env_choices, default=1, max_length=1)
Staging_choices = ((1, 'Yes'), (2, 'No'))
Plan = models.TextField(blank=True)
Staging = models.SmallIntegerField(choices=Staging_choices, default=1, max_length=1)
Design_status_choices = ((1, 'Design Prepared'), (2, 'Design Pending'), (3,'Design in Progress'),
(4, 'Design to be validated'), (5, 'Design Rework in Progress'),
(6, 'Pending Information from User'), (7, 'Ticket can be closed as change exists'),
(8, 'No design required'), (9, 'Line Item can be closed'), (10, 'Consulting Request'),
(11, 'Service Request'), (12, 'Ticket transferred to AMRS IPAM'),
(13, 'Ticket transferred to EMEA IPAM'), (14, 'Ticket transferred to APAC IPAM'),
(15, 'Ticket transferred to GBAM IPAM'), (16, 'Ticket Pended'),
(17, 'Ticket Pending to be Closed'), (18, 'Ticket Cancelled'), (19, 'Ticket Closed'))
Design_status = models.SmallIntegerField(choices=Design_status_choices, default=1, max_length=1,
verbose_name='Design Status')
Design_num = models.CharField(max_length=200, verbose_name='Istrat/Roars/SSL Cert', blank=True)
Peer_review_choices = ((1, 'Approved'), (2, 'Not Required'), (3, 'Pending'), (4, 'Rejected'))
Peer_review_status = models.SmallIntegerField(choices=Peer_review_choices, max_length=1, default=1)
User_test_choices = ((1, 'Yes-Conference Bridge'), (2, 'Yes-Email Notification'),
(3, 'Validation Waived off'), (4, 'No'))
User_testing = models.SmallIntegerField(choices=User_test_choices, default=1,
verbose_name='User Testing Required?')
User_bridge_choices = ((1, 'Yes'), (2, 'No'), (3, 'Not Applicable'))
User_bridge = models.SmallIntegerField(choices=User_bridge_choices, default=1,
verbose_name='User Bridgeline Required?')
User_bridge_details = models.TextField(blank=True, max_length=200, verbose_name='User Bridge Details')
Meeting_invite = models.SmallIntegerField(choices=Staging_choices, default=2,
verbose_name='Meeting Invite Sent?')
Time_based = models.SmallIntegerField(choices=Staging_choices, default=1, verbose_name='Time Based?')
RFC_Start = models.DateTimeField(help_text='in EST', verbose_name='RFC Start Time', blank=True, null=True)
RFC_End = models.DateTimeField(help_text='in EST', verbose_name='RFC End Time', blank=True, null=True)
Change_implementer = models.ForeignKey(User, related_name='change_implementer',
verbose_name='Change Implementer', null=True, default='none', blank=True)
Start_notification = models.SmallIntegerField(choices=Staging_choices, default=2,
verbose_name='Start Notification')
End_notification = models.SmallIntegerField(choices=Staging_choices, default=2, verbose_name='End Notification')
Change_status_choices = ((1, 'Not yet Started'), (2, 'In Progress'), (3, 'Completed'),
(4, 'Rescheduled'), (5, 'Cancelled'), (6, 'Backed Out'), (7, 'Incomplete'))
Change_status = models.SmallIntegerField(choices=Change_status_choices, default=1, verbose_name='Change Status')
RFC_closure_choices = ((1, 'Yes'), (2, 'No'), (3, 'On hold'))
RFC_closure = models.SmallIntegerField(choices=RFC_closure_choices, default=2, verbose_name='RFC Closed')
Change_validation = models.SmallIntegerField(choices=Staging_choices, default=2, verbose_name='Change Validation')
Ticket_closure_choices = ((1, 'Closed'), (2, 'Pending to be closed'), (3, 'Awaiting user confirmation'))
Ticket_closure = models.SmallIntegerField(choices=Ticket_closure_choices, default=2,
verbose_name='MAC/IStrat/Roars/\neConnect Closed?')
def __unicode__(self):
return self.Reference
class Meta:
verbose_name = u"Change"
verbose_name_plural = verbose_name
class MyChange(Change):
class Meta:
proxy = True
verbose_name = u"Closed Changes"
verbose_name_plural = verbose_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment