app/projrev/models.py
changeset 34 21942fac2b4b
parent 32 b39994cca761
child 35 c64531b3afb4
equal deleted inserted replaced
33:2840389ee7f9 34:21942fac2b4b
    10 
    10 
    11 from django.db import models
    11 from django.db import models
    12 from django.contrib.auth.models import User
    12 from django.contrib.auth.models import User
    13 
    13 
    14 
    14 
       
    15 def sort_dict(d):
       
    16   """Function to sort dictionary elements.
       
    17   """
       
    18 
       
    19   items =  [(v, k) for k, v in d.items()]
       
    20   items.sort()
       
    21   return [(k, v) for v, k in items]
       
    22 
       
    23 
    15 class Project(models.Model):
    24 class Project(models.Model):
    16   """Model class for NME funded projects.
    25   """Model class for NME funded projects.
    17   """
    26   """
    18 
    27 
    19   LINE_ITEM_CHOICES = [('ME', 'Mechanical'), 
    28   LINE_ITEM_CHOICES = {
    20                        ('CE', 'Chemical'),
    29       "NP": "NPTEL  phase II / III",
    21                        ('EE', 'Electrical'),
    30       "PG": "PG Classes",
    22                        ('AE', 'Aero Space'),
    31       "UG": "UG Classes",
    23                        ('CS', 'Computer Science'),
    32       "VC": "Video content digitization, conversion,  chunking and dubbing CEC / IGNOU / NCERT / SIET / OTHERS",
    24                        ('IT', 'Information Technology'),
    33       "PE": "Provision of e-books and e-journals free to the learners",
    25                       ]
    34       "SQ": "Standardisation of quality assurance of contents & certification / automation of certification",
    26 
    35       "DS": "Developing suitable pedagogical methods for various classes, intellectual calibers and research in e-learning",
    27   STATE_CHOICES = [('MH', 'Maharashtra'), 
    36       "DL": "Development of language converter and translation tool kit",
    28                    ('KA', 'Karnataka'),
    37       "DR": "Development and realization of Virtual Reality Laboratories and supporting facilities for e-learning",
    29                    ('KL', 'Kerala'),
    38       "DC": "Development of Certification & Testing Modules for Virtual Technological Universities & creation of VTU, multi media research and international programmes",
    30                    ('TN', 'Tamil Nadu'),
    39       "ED": "Experimentation and Development of ultra low cost access devices for wider coverage of learners & their field trials",
    31                    ('AP', 'Andra Pradesh'),
    40       "TT": "Talk to a teacher to provide a substitute for coaching for the economically poor students",
    32                   ]
    41       "DH": "Development of software controlled hardware programming for robotics other crucial areas",
    33 
    42       "AD": "Adaptation & deployment of open source simulation packages equivalent to MATLAB, ORCAD etc.",
    34   DISTRICT_CHOICES = [('AD', 'Adilabad'),
    43       "DU": "Development of unified ERP system for Educational Institutions",
    35                       ('RT', 'Ratnagiri'),
    44       "PT": "Publicity & training of motivators & trainers to ensure full utilization of the systems by institutions & students. Teacher Empowerment 'B'",
    36                       ('MU', 'Mumbai suburban'),
    45       "CC": "Conversion of available content in various regional languages",
    37                       ('PU', 'Pune'),
    46       "DV": "Development of Vocational Educational modules and use of haptic devices for education & training",
    38                       ('PL', 'Palakkad'),
    47       }
    39                       ('BN', 'Bangalore Urban district'),
    48 
    40                       ('CK', 'Chikmagalur District'),
    49   STATE_CHOICES = {
    41                      ]
    50       "AN": "Andaman & Nicobar", 
       
    51       "DN": "Dadra and Nagar Haveli", 
       
    52       "DL": "Delhi", 
       
    53       "WB": "West Bengal", 
       
    54       "HR": "Haryana", 
       
    55       "HP": "Himachal Pradesh", 
       
    56       "UP": "Uttar Pradesh", 
       
    57       "JH": "Jharkhand", 
       
    58       "BR": "Bihar", 
       
    59       "JK": "Jammu & Kashmir", 
       
    60       "TN": "Tamil Nadu", 
       
    61       "LD": "Lakshadweep", 
       
    62       "NL": "Nagaland", 
       
    63       "PY": "Pondicherry", 
       
    64       "TR": "Tripura", 
       
    65       "PB": "Punjab", 
       
    66       "DD": "Daman & Diu", 
       
    67       "RJ": "Rajasthan", 
       
    68       "CH": "Chandigarh", 
       
    69       "CG": "Chattisgarh", 
       
    70       "AP": "Andhra Pradesh", 
       
    71       "AS": "Assam", 
       
    72       "AR": "Arunachal Pradesh", 
       
    73       "GA": "Goa", 
       
    74       "GJ": "Gujarat", 
       
    75       "KA": "Karnataka", 
       
    76       "UA": "Uttarakhand", 
       
    77       "ML": "Meghalaya", 
       
    78       "MN": "Manipur", 
       
    79       "MH": "Maharashtra", 
       
    80       "KL": "Kerala", 
       
    81       "SK": "Sikkim", 
       
    82       "MP": "Madhya Pradesh", 
       
    83       "OR": "Orissa", 
       
    84       "MZ": "Mizoram"
       
    85       }
       
    86 
       
    87   DISTRICT_CHOICES = {
       
    88       "JHES": "Purba Singhbhum", 
       
    89       "TNRA": "Ramanathapuram", 
       
    90       "PBAM": "Amritsar", 
       
    91       "ORMY": "Mayurbhanj", 
       
    92       "UPMG": "Maharajganj", 
       
    93       "ORML": "Malkangiri", 
       
    94       "MZAI": "Aizawl", 
       
    95       "NLKO": "Kohima", 
       
    96       "PBFR": "Faridkot", 
       
    97       "ARPA": "Papum Pare", 
       
    98       "SKES": "East Sikkim", 
       
    99       "UAPI": "Pithoragharh", 
       
   100       "MHNS": "Nashik", 
       
   101       "PBFI": "Firozpur", 
       
   102       "KAKD": "Kodagu", 
       
   103       "APRA": "Rangareddi", 
       
   104       "BRSO": "Sheohar", 
       
   105       "UPSV": "Shravasti", 
       
   106       "KAKL": "Kolar District", 
       
   107       "PYPO": "Puducherry", 
       
   108       "UPSU": "Sultanpur", 
       
   109       "UPSR": "Sant Ravidas Nagar", 
       
   110       "MHRT": "Ratnagiri", 
       
   111       "UPSN": "Siddharthnagar", 
       
   112       "PBHO": "Hoshiarpur", 
       
   113       "UPSJ": "Shahjahanpur", 
       
   114       "KAKP": "Koppal District", 
       
   115       "UPSI": "Sitapur", 
       
   116       "BRSP": "Sheikhpura", 
       
   117       "BRSR": "Saran", 
       
   118       "BRSU": "Supaul", 
       
   119       "BRST": "Sitamarhi", 
       
   120       "BRSW": "Siwan", 
       
   121       "UPSA": "Saharanpur", 
       
   122       "KADH": "Dharwad District", 
       
   123       "JHLO": "Lohardaga", 
       
   124       "ASSO": "Sonitpur", 
       
   125       "KADK": "Dakshina Kannada", 
       
   126       "ASSI": "Sibsagar", 
       
   127       "KADA": "Davanagere District", 
       
   128       "ORJP": "Jajapur (Jajpur)", 
       
   129       "ORJS": "Jagatsinghpur", 
       
   130       "UPMP": "Mainpuri", 
       
   131       "MHBU": "Buldhana", 
       
   132       "TNKR": "Karur", 
       
   133       "WBME": "Midnapore", 
       
   134       "UPUN": "Unnao", 
       
   135       "TNKC": "Kanchipuram", 
       
   136       "SKSS": "South Sikkim", 
       
   137       "MPUM": "Umaria", 
       
   138       "JKJA": "Jammu", 
       
   139       "MPUJ": "Ujjain", 
       
   140       "CGMA": "Mahasamund", 
       
   141       "GJPA": "Patan", 
       
   142       "UACL": "Chamoli", 
       
   143       "PYMA": "Mahe", 
       
   144       "GJPO": "Porbandar", 
       
   145       "GJPM": "Panchmahal", 
       
   146       "RJHA": "Hanumangarh", 
       
   147       "WBDD": "Dakshin Dinajpur", 
       
   148       "WBDA": "Darjeeling", 
       
   149       "HPUN": "Una", 
       
   150       "PBFT": "Fatehgarh Sahib", 
       
   151       "MHLA": "Latur", 
       
   152       "GJVD": "Vadodara", 
       
   153       "UPLK": "Lakhimpur Kheri", 
       
   154       "JHBO": "Bokaro", 
       
   155       "HRHI": "Hissar", 
       
   156       "WBJA": "Jalpaiguri", 
       
   157       "UPDE": "Deoria", 
       
   158       "MPRE": "Rewa", 
       
   159       "MPRG": "Rajgarh", 
       
   160       "MPRL": "Ratlam", 
       
   161       "ASLA": "Lakhimpur", 
       
   162       "MPRS": "Raisen", 
       
   163       "HPMA": "Mandi", 
       
   164       "PBMU": "Mukatsar", 
       
   165       "BRPA": "Patna", 
       
   166       "BRRO": "Rohtas", 
       
   167       "PBMA": "Mansa", 
       
   168       "BRPU": "Purnia", 
       
   169       "PBMO": "Moga", 
       
   170       "RJSR": "Sirohi", 
       
   171       "MHAH": "Ahmednagar", 
       
   172       "MHAK": "Akola", 
       
   173       "MHAM": "Amrawati", 
       
   174       "HRSN": "Sonepat", 
       
   175       "MHAU": "Aurangabad", 
       
   176       "ARTI": "Tirap", 
       
   177       "PBBA": "Bathinda", 
       
   178       "RJSK": "Sikar", 
       
   179       "KAUD": "Udupi District", 
       
   180       "RJSM": "Sawai Madhopur", 
       
   181       "RJAJ": "Ajmer", 
       
   182       "APVZ": "Vizianagaram", 
       
   183       "RJAL": "Alwar", 
       
   184       "MHWR": "Wardha", 
       
   185       "MHWS": "Washim", 
       
   186       "APVS": "Vishakhapatnam", 
       
   187       "KAHV": "Haveri District", 
       
   188       "KAHS": "Hassan District", 
       
   189       "MPGW": "Gwalior", 
       
   190       "MPGU": "Guna", 
       
   191       "JHPK": "Pakur", 
       
   192       "JHPL": "Palamu", 
       
   193       "UPEW": "Etawah", 
       
   194       "UPKU": "Kushinagar", 
       
   195       "UPKS": "Kaushambi", 
       
   196       "BRSH": "Saharsa", 
       
   197       "UPKD": "Kanpur Dehat", 
       
   198       "PBPA": "Patiala", 
       
   199       "UPKN": "Kanpur Nagar", 
       
   200       "BRSM": "Samastipur", 
       
   201       "UPVA": "Varanasi", 
       
   202       "UPKJ": "Kannauj", 
       
   203       "APCH": "Chittoor", 
       
   204       "HRRE": "Rewari", 
       
   205       "NLZU": "Zunheboto", 
       
   206       "BRBU": "Buxar", 
       
   207       "HRRO": "Rohtak", 
       
   208       "TNCH": "Chennai", 
       
   209       "BRBJ": "Bhojpur", 
       
   210       "UATG": "Tehri Garhwal", 
       
   211       "BRBG": "Bhagalpur", 
       
   212       "BRBE": "Begusarai", 
       
   213       "BRBA": "Banka", 
       
   214       "MHHI": "Hingoli", 
       
   215       "UPJP": "Jyotiba Phule Nagar", 
       
   216       "GJBR": "Bharuch", 
       
   217       "GJBV": "Bhavnagar", 
       
   218       "GJBK": "Banaskantha", 
       
   219       "TRST": "South Tripura", 
       
   220       "GANG": "North Goa", 
       
   221       "ORPU": "Puri", 
       
   222       "KACK": "Chikballapur District", 
       
   223       "UPSO": "Sonbhadra", 
       
   224       "HRMW": "Mewat", 
       
   225       "RJTO": "Tonk", 
       
   226       "NLDI": "Dimapur", 
       
   227       "HRMA": "Mahendragarh", 
       
   228       "UPSK": "Sant Kabir Nagar", 
       
   229       "MZCH": "Champhai", 
       
   230       "BRLA": "Lakhisarai", 
       
   231       "UPJH": "Jhansi", 
       
   232       "ARAJ": "Anjaw", 
       
   233       "UAUS": "Udham Singh Nagar", 
       
   234       "UPRB": "Rae Bareli", 
       
   235       "UAUT": "Uttarkashi", 
       
   236       "ASTI": "Tinsukia", 
       
   237       "KLKL": "Kollam", 
       
   238       "KLKN": "Kannur", 
       
   239       "KLKS": "Kasaragod", 
       
   240       "KLKT": "Kottayam", 
       
   241       "KLKZ": "Kozhikode", 
       
   242       "MHBI": "Beed", 
       
   243       "MPHA": "Harda", 
       
   244       "MHBH": "Bhandara", 
       
   245       "MHST": "Satara", 
       
   246       "MPHO": "Hoshangabad", 
       
   247       "MHSN": "Sangli", 
       
   248       "MHSO": "Solapur", 
       
   249       "ASBA": "Barpeta", 
       
   250       "KASH": "Shimoga District", 
       
   251       "MHSI": "Sindhudurg", 
       
   252       "ASBO": "Bongaigaon", 
       
   253       "MZLU": "Lunglei", 
       
   254       "MPCT": "Chhatarpur", 
       
   255       "BRKI": "Kishanganj", 
       
   256       "BRKH": "Khagaria", 
       
   257       "HPSO": "Solan", 
       
   258       "KLTV": "Thiruvananthapuram", 
       
   259       "BRKM": "Kaimur", 
       
   260       "HPSH": "Shimla", 
       
   261       "KLTS": "Thrissur", 
       
   262       "MNCC": "Churachandpur", 
       
   263       "ORBH": "Bhadrak", 
       
   264       "MZLA": "Lawngtlai", 
       
   265       "BRKT": "Katihar", 
       
   266       "ORJH": "Jharsuguda", 
       
   267       "MPCN": "Chhindwara", 
       
   268       "APCU": "Kadapa", 
       
   269       "ORBD": "Boudh (Bauda)", 
       
   270       "PYKA": "Karaikal", 
       
   271       "UPGZ": "Ghaziabad", 
       
   272       "UPGR": "Gorkakhpur", 
       
   273       "UPGP": "Ghazipur", 
       
   274       "GASG": "South Goa", 
       
   275       "JHCH": "Chatra", 
       
   276       "MHOS": "Osmanabad", 
       
   277       "UPGN": "Gonda", 
       
   278       "GJAH": "Ahmedabad", 
       
   279       "WBNA": "Nadia", 
       
   280       "GJAM": "Amreli District", 
       
   281       "GJAN": "Anand", 
       
   282       "JKBR": "Baramula", 
       
   283       "APGU": "Guntur", 
       
   284       "ASMA": "Marigaon", 
       
   285       "JKBD": "Badgam", 
       
   286       "WBUD": "Uttar Dinajpur", 
       
   287       "TNSI": "Sivagangai", 
       
   288       "TNSA": "Salem", 
       
   289       "MHDH": "Dhule", 
       
   290       "PBNS": "Nawan Shehar", 
       
   291       "PBGU": "Gurdaspur", 
       
   292       "ARWK": "West Kameng", 
       
   293       "RJPA": "Pali", 
       
   294       "UPAG": "Agra", 
       
   295       "WBBI": "Birbhum", 
       
   296       "RJPG": "Pratapgarh", 
       
   297       "JKPO": "Poonch", 
       
   298       "KLPL": "Palakkad", 
       
   299       "APPR": "Prakasam", 
       
   300       "KLPT": "Pathanamthitta", 
       
   301       "TNAY": "Ariyalur", 
       
   302       "JKPU": "Pulwama", 
       
   303       "RJBW": "Bhilwara", 
       
   304       "RJBN": "Banswara", 
       
   305       "AREL": "Lohit", 
       
   306       "RJBM": "Barmer", 
       
   307       "AREK": "East Kameng", 
       
   308       "RJBI": "Bikaner", 
       
   309       "ORCU": "Cuttack", 
       
   310       "RJBU": "Bundi", 
       
   311       "RJBR": "Baran", 
       
   312       "KLWA": "Wayanad", 
       
   313       "RJBP": "Bharatpur", 
       
   314       "MHYA": "Yavatmal", 
       
   315       "ORAN": "Angul", 
       
   316       "UPAU": "Auraiya", 
       
   317       "WBMA": "Malda", 
       
   318       "MPTI": "Tikamgarh", 
       
   319       "GJSN": "Surendranagar", 
       
   320       "APNE": "Nellore", 
       
   321       "GJSK": "Sabarkantha", 
       
   322       "APNI": "Nizamabad", 
       
   323       "DLSW": "South West Delhi", 
       
   324       "BRGA": "Gaya", 
       
   325       "DLSD": "South Delhi", 
       
   326       "GJST": "Surat", 
       
   327       "UPBD": "Badaun", 
       
   328       "ORSO": "Subarnapur (Sonepur)", 
       
   329       "JHGI": "Giridih", 
       
   330       "JHGO": "Godda", 
       
   331       "WBHR": "Howrah", 
       
   332       "TNTJ": "Thanjavur", 
       
   333       "TNTK": "Thoothukudi", 
       
   334       "JHGA": "Garhwa", 
       
   335       "TNTI": "Tirunelveli", 
       
   336       "TNTL": "Thiruvallur", 
       
   337       "ORSA": "Sambalpur", 
       
   338       "KLER": "Ernakulam", 
       
   339       "TNKK": "Kanyakumari", 
       
   340       "TNTP": "Tiruppur", 
       
   341       "TNTV": "Tiruvannamalai", 
       
   342       "WBMU": "Murshidabad", 
       
   343       "MHKO": "Kolhapur", 
       
   344       "ORSU": "Sundargarh (Sundergarh)", 
       
   345       "UPBG": "Bagpat", 
       
   346       "JHGU": "Gumla", 
       
   347       "SKNS": "North Sikkim", 
       
   348       "RJUD": "Udaipur", 
       
   349       "TRDH": "Dhalai", 
       
   350       "MLEG": "East Garo Hills", 
       
   351       "UPCD": "Chandauli", 
       
   352       "HRJH": "Jhajjar", 
       
   353       "HRJI": "Jind", 
       
   354       "MLSG": "South Garo Hills", 
       
   355       "DLCD": "Central Delhi", 
       
   356       "UPCT": "Chitrakoot", 
       
   357       "MNUK": "Ukhrul", 
       
   358       "DLED": "East Delhi", 
       
   359       "PBJA": "Jalandhar", 
       
   360       "CGRN": "Rajnandgaon", 
       
   361       "PYYA": "Yanam", 
       
   362       "KABG": "Belgaum District", 
       
   363       "KABD": "Bidar District", 
       
   364       "KABJ": "Bijapur District", 
       
   365       "KABK": "Bagalkot District", 
       
   366       "CGRG": "Raigarh", 
       
   367       "KABN": "Bangalore Urban district", 
       
   368       "KABL": "Bellary District", 
       
   369       "KABR": "Bangalore Rural District", 
       
   370       "UPPR": "Pratapgarh", 
       
   371       "CGRP": "Raipur", 
       
   372       "TNTC": "Tiruchirappalli", 
       
   373       "UPME": "Meerut", 
       
   374       "MLEK": "East Khasi Hills", 
       
   375       "DLWD": "West Delhi", 
       
   376       "UPMB": "Mau", 
       
   377       "UPMO": "Moradabad", 
       
   378       "UPMH": "Mahoba", 
       
   379       "KATU": "Tumkur District", 
       
   380       "MPKA": "Katni", 
       
   381       "UPMT": "Mathura", 
       
   382       "UPMU": "Muzaffarnagar", 
       
   383       "TNMA": "Madurai", 
       
   384       "JKLE": "Leh", 
       
   385       "APMA": "Mahbubnagar", 
       
   386       "ASCA": "Cachar", 
       
   387       "APME": "Medak", 
       
   388       "MHRG": "Raigad", 
       
   389       "MPBP": "Bhopal", 
       
   390       "MPBR": "Barwani", 
       
   391       "MNBI": "Bishnupur", 
       
   392       "GJVL": "Valsad", 
       
   393       "NLPH": "Phek", 
       
   394       "RJNA": "Nagaur", 
       
   395       "BRDA": "Darbhanga", 
       
   396       "MPBE": "Betul", 
       
   397       "MPBD": "Bhind", 
       
   398       "PBLU": "Ludhiana", 
       
   399       "MPBL": "Balaghat", 
       
   400       "MZKO": "Kolasib", 
       
   401       "APNA": "Nalgonda", 
       
   402       "HPBI": "Bilaspur", 
       
   403       "UPJU": "Jaunpur District", 
       
   404       "GJDG": "The Dangs", 
       
   405       "GJDA": "Dahod", 
       
   406       "WBHG": "Hooghly", 
       
   407       "NLWO": "Wokha", 
       
   408       "MPPA": "Panna", 
       
   409       "UPJL": "Jalaun", 
       
   410       "ASJO": "Jorhat", 
       
   411       "WBKO": "Kolkata", 
       
   412       "HPKU": "Kulu", 
       
   413       "HRSI": "Sirsa", 
       
   414       "MLJH": "Jaintia Hills", 
       
   415       "HPKI": "Kinnaur", 
       
   416       "UADD": "Dehradun", 
       
   417       "UACP": "Champawat", 
       
   418       "HPKA": "Kangra", 
       
   419       "TNPU": "Pudukkottai", 
       
   420       "JHKO": "Koderma", 
       
   421       "UPRA": "Rampur", 
       
   422       "TNPE": "Perambalur", 
       
   423       "HRAM": "Ambala", 
       
   424       "MHGO": "Gondiya", 
       
   425       "KLAL": "Alappuzha", 
       
   426       "MHGA": "Gadchiroli", 
       
   427       "KAMA": "Mandya District", 
       
   428       "BRMP": "Madhepura", 
       
   429       "BRMZ": "Muzaffarpur", 
       
   430       "BRMG": "Munger", 
       
   431       "JKSR": "Samba", 
       
   432       "BRMB": "Madhubani", 
       
   433       "KAMY": "Mysore District", 
       
   434       "RJGA": "Ganganagar", 
       
   435       "BRGO": "Gopalganj", 
       
   436       "ORDH": "Dhenkanal", 
       
   437       "MPEN": "Khandwa (East Nimar)", 
       
   438       "JHRA": "Ranchi", 
       
   439       "JHRM": "Ramgarh District", 
       
   440       "BRVA": "Vaishali", 
       
   441       "HPLS": "Lahaul and Spiti", 
       
   442       "GJKA": "Kutch", 
       
   443       "UARP": "Rudraprayag", 
       
   444       "GJKH": "Kheda", 
       
   445       "MPSI": "Sidhi", 
       
   446       "MPWN": "Khargone (West Nimar)", 
       
   447       "PBRU": "Rupnagar", 
       
   448       "MNSE": "Senapati", 
       
   449       "APAN": "Anantapur", 
       
   450       "NLTU": "Tuensang", 
       
   451       "CGJA": "Jashpur", 
       
   452       "ASGG": "Golaghat", 
       
   453       "CGJC": "Janjgir-Champa", 
       
   454       "APAD": "Adilabad", 
       
   455       "RJJW": "Jhalawar", 
       
   456       "UPMI": "Mirzapur", 
       
   457       "RJJS": "Jaisalmer", 
       
   458       "RJJP": "Jaipur", 
       
   459       "ASGP": "Goalpara", 
       
   460       "RJJL": "Jalore", 
       
   461       "RJJJ": "Juhnjhunun", 
       
   462       "HPHA": "Hamirpur", 
       
   463       "MPSR": "Sehore", 
       
   464       "TNTH": "Theni", 
       
   465       "MLWG": "West Garo Hills", 
       
   466       "CGDH": "Dhamtari", 
       
   467       "MHND": "Nanded", 
       
   468       "MHNG": "Nagpur", 
       
   469       "MLWK": "West Khasi Hills", 
       
   470       "CGDA": "Dantewada", 
       
   471       "HRFT": "Fatehabad", 
       
   472       "CGDU": "Durg", 
       
   473       "HRFR": "Faridabad", 
       
   474       "TNTR": "Thiruvarur", 
       
   475       "UPFI": "Firozabad", 
       
   476       "JKAN": "Anantnag", 
       
   477       "UPFT": "Fatehpur", 
       
   478       "ASNL": "Nalbari", 
       
   479       "APKA": "Karimnagar", 
       
   480       "HRPP": "Panipat", 
       
   481       "UPFR": "Farrukhabad", 
       
   482       "ASNG": "Nagaon", 
       
   483       "ASNC": "North Cachar Hills", 
       
   484       "UPFZ": "Faizabad", 
       
   485       "MNTH": "Thoubal", 
       
   486       "WBPN": "North 24 Parganas", 
       
   487       "TRWT": "West Tripura", 
       
   488       "MNTA": "Tamenglong", 
       
   489       "PBKA": "Kapurthala", 
       
   490       "RJDA": "Dausa", 
       
   491       "WBPS": "South 24 Parganas", 
       
   492       "UPPI": "Pilibhit", 
       
   493       "KLMA": "Malappuram", 
       
   494       "ARCH": "Changlang", 
       
   495       "WBPU": "Purulia", 
       
   496       "MHCH": "Chandrapur", 
       
   497       "KACJ": "Chamarajnagar District", 
       
   498       "ORKN": "Kandhamal", 
       
   499       "ORKO": "Koraput", 
       
   500       "ORKL": "Kalahandi", 
       
   501       "ORKJ": "Kendujhar (Keonjhar)", 
       
   502       "ORKH": "Khordha", 
       
   503       "NLMK": "Mokokchung", 
       
   504       "ORKP": "Kendrapara", 
       
   505       "NLMN": "Mon", 
       
   506       "KACT": "Chitradurga District", 
       
   507       "CGSU": "Surguja", 
       
   508       "MPNE": "Neemuch", 
       
   509       "TNNM": "Namakkal", 
       
   510       "MPNA": "Narsinghpur", 
       
   511       "TNNI": "The Nilgiris", 
       
   512       "TNNG": "Nagapattinam", 
       
   513       "APHY": "Hyderabad", 
       
   514       "UANA": "Nainital", 
       
   515       "APSR": "Srikakulam", 
       
   516       "RJCR": "Churu", 
       
   517       "RJCT": "Chittorgarh", 
       
   518       "MZMA": "Mamit", 
       
   519       "MHMC": "Mumbai City", 
       
   520       "UPET": "Etah", 
       
   521       "GJGA": "Gandhinagar", 
       
   522       "MHMU": "Mumbai suburban", 
       
   523       "WBKB": "Cooch Behar", 
       
   524       "HPCH": "Chamba", 
       
   525       "MPSG": "Sagar", 
       
   526       "HRPK": "Panchkula", 
       
   527       "ASKR": "Karimganj", 
       
   528       "MPSO": "Seoni", 
       
   529       "GJNV": "Navsari", 
       
   530       "MPSJ": "Shajapur", 
       
   531       "MPSH": "Shahdol", 
       
   532       "GJNR": "Narmada", 
       
   533       "MPSV": "Shivpuri", 
       
   534       "MPST": "Satna", 
       
   535       "ASKA": "Karbi Anglong", 
       
   536       "MPSP": "Sheopur", 
       
   537       "APEG": "East Godavari", 
       
   538       "HRPW": "Palwal", 
       
   539       "JKDO": "Doda", 
       
   540       "ASKK": "Kokrajhar", 
       
   541       "JHDU": "Dumka", 
       
   542       "ORRA": "Rayagada", 
       
   543       "JHDE": "Deoghar", 
       
   544       "MHJG": "Jalgaon", 
       
   545       "HRBH": "Bhiwani", 
       
   546       "TNDH": "Dharmapuri", 
       
   547       "JHDH": "Dhanbad", 
       
   548       "MHJN": "Jalna", 
       
   549       "UPBI": "Bijnor", 
       
   550       "UPBH": "Bahraich", 
       
   551       "UPBL": "Ballia", 
       
   552       "UPBN": "Banda District", 
       
   553       "HRKR": "Karnal", 
       
   554       "UPBB": "Barabanki", 
       
   555       "MZSE": "Serchhip", 
       
   556       "HRKU": "Kurukshetra", 
       
   557       "HRKT": "Kaithal", 
       
   558       "MNCD": "Chandel", 
       
   559       "MZSA": "Saiha", 
       
   560       "UPBP": "Balrampur", 
       
   561       "UPBS": "Basti", 
       
   562       "UPBR": "Bareilly", 
       
   563       "UPBU": "Bulandshahr", 
       
   564       "MLRB": "Ri-Bhoi", 
       
   565       "JKRA": "Rajauri", 
       
   566       "ORBR": "Bargarh (Baragarh)", 
       
   567       "BRNW": "Nawada", 
       
   568       "MHTH": "Thane", 
       
   569       "HPSI": "Sirmaur", 
       
   570       "RJDU": "Dungapur", 
       
   571       "APWA": "Warangal", 
       
   572       "ORBW": "Baleswar (Balasore)", 
       
   573       "TNER": "Erode", 
       
   574       "BRNL": "Nalanda", 
       
   575       "MPDE": "Dewas", 
       
   576       "KAGU": "Gulbarga District", 
       
   577       "TRNT": "North Tripura", 
       
   578       "KLID": "Idukki", 
       
   579       "MPDI": "Dindori", 
       
   580       "MPDH": "Dhar", 
       
   581       "KAGA": "Gadag District", 
       
   582       "MPDT": "Datia", 
       
   583       "JHSA": "Sahibganj", 
       
   584       "ORGP": "Gajapati", 
       
   585       "UAPG": "Pauri Garhwal", 
       
   586       "ORBL": "Bolangir (Balangir)", 
       
   587       "MPJH": "Jhabua", 
       
   588       "UPLA": "Lalitpur", 
       
   589       "MPJA": "Jabalpur", 
       
   590       "JKKR": "Kargil", 
       
   591       "JKKT": "Kathua", 
       
   592       "JKKU": "Kupwara", 
       
   593       "WBBN": "Bankura", 
       
   594       "KAUK": "Uttara Kannada", 
       
   595       "ASDI": "Dibrugarh", 
       
   596       "UPLU": "Lucknow", 
       
   597       "WBBR": "Bardhaman", 
       
   598       "ASDM": "Dhemaji", 
       
   599       "ASDA": "Darrang", 
       
   600       "ASDB": "Dhubri", 
       
   601       "HRYN": "Yamuna Nagar", 
       
   602       "BREC": "Purba Champaran", 
       
   603       "UABA": "Bageshwar", 
       
   604       "TNCU": "Cuddalore", 
       
   605       "MPMS": "Mandsaur", 
       
   606       "MPML": "Mandla", 
       
   607       "GJRA": "Rajkot", 
       
   608       "MPMO": "Morena", 
       
   609       "TNCO": "Coimbatore", 
       
   610       "GJJU": "Junagadh", 
       
   611       "TNVE": "Vellore", 
       
   612       "TNVL": "Villupuram", 
       
   613       "UPHR": "Hardoi", 
       
   614       "ORDE": "Debagarh (Deogarh)", 
       
   615       "HRGU": "Gurgaon", 
       
   616       "RJJO": "Jodhpur", 
       
   617       "UPAH": "Allahabad", 
       
   618       "UPAL": "Aligarh", 
       
   619       "UPAN": "Ambedkar Nagar", 
       
   620       "CGBI": "Bilaspur", 
       
   621       "APWG": "West Godavari", 
       
   622       "UPAZ": "Azamgarh", 
       
   623       "CGBA": "Bastar", 
       
   624       "ORNY": "Nayagarh", 
       
   625       "BRWC": "Pashchim Champaran", 
       
   626       "ORNU": "Nuapada", 
       
   627       "MNWI": "Imphal West", 
       
   628       "UAAL": "Almora", 
       
   629       "JHHA": "Hazaribagh", 
       
   630       "ORNB": "Nabarangpur", 
       
   631       "ARUD": "Dibang Valley", 
       
   632       "ARUB": "Upper Subansiri", 
       
   633       "RJRA": "Rajsamand", 
       
   634       "APKR": "Krishna", 
       
   635       "MHPU": "Pune", 
       
   636       "APKU": "Kurnool", 
       
   637       "MPIN": "Indore", 
       
   638       "ASHA": "Hailakandi", 
       
   639       "UPGB": "Gautam Buddha Nagar", 
       
   640       "MHPA": "Parbhani", 
       
   641       "KARA": "Raichur District", 
       
   642       "SKWS": "West Sikkim", 
       
   643       "APKH": "Khammam", 
       
   644       "KARM": "Ramanagara District", 
       
   645       "DLNO": "North Delhi", 
       
   646       "BRJE": "Jehanabad", 
       
   647       "BRJA": "Jamui", 
       
   648       "JHWS": "Pashchim Singhbhum", 
       
   649       "DLND": "New Delhi", 
       
   650       "DLNE": "North East Delhi", 
       
   651       "DLNW": "North West Delhi", 
       
   652       "RJDH": "Dholpur", 
       
   653       "TNDI": "Dindigul", 
       
   654       "JKUD": "Udhampur", 
       
   655       "GJJA": "Jamnagar", 
       
   656       "UPHM": "Hamirpur", 
       
   657       "PBSA": "Sangrur", 
       
   658       "MPVI": "Vidisha", 
       
   659       "ORGN": "Ganjam", 
       
   660       "MHNB": "Nandurbar", 
       
   661       "UPHT": "Mahamaya Nagar", 
       
   662       "BRAR": "Araria", 
       
   663       "JKBP": "Bandipore", 
       
   664       "CGKB": "Korba", 
       
   665       "BRAU": "Aurangabad", 
       
   666       "CGKK": "Kanker", 
       
   667       "CGKJ": "Koriya", 
       
   668       "CGKW": "Kawardha", 
       
   669       "UAHA": "Haridwar", 
       
   670       "GJMA": "Mehsana", 
       
   671       "RJKO": "Kota", 
       
   672       "MNEI": "Imphal East", 
       
   673       "RJKA": "Karauli", 
       
   674       "ARLB": "Lower Subansiri", 
       
   675       "MPDM": "Damoh"
       
   676       }
    42 
   677 
    43   # Field containing the Line Item to which the project belongs to.
   678   # Field containing the Line Item to which the project belongs to.
    44   line_item = models.CharField(max_length=256,
   679   line_item = models.CharField(max_length=256,
    45                                choices=LINE_ITEM_CHOICES)
   680                                choices=tuple(LINE_ITEM_CHOICES))
       
   681   line_item.help_text = 'Select from one of the Line Items.'
    46 
   682 
    47   # Field containing the name of the institution working on the
   683   # Field containing the name of the institution working on the
    48   # project.
   684   # project.
    49   institution = models.CharField(max_length=256)
   685   institution = models.CharField(max_length=256)
       
   686   institution.help_text = 'Give the full name of your institution.'
    50 
   687 
    51   # Field containing the state to which the institution belongs to.
   688   # Field containing the state to which the institution belongs to.
    52   state = models.CharField(max_length=256,
   689   state = models.CharField(
    53                            choices=STATE_CHOICES)
   690       max_length=256,
       
   691       choices=sorted(STATE_CHOICES.items(), key=lambda (k,v): (v,k)))
       
   692   state.help_text = 'Select the state in which this project is taken up.'
    54 
   693 
    55   # Field containing the district to which the institution belongs
   694   # Field containing the district to which the institution belongs
    56   # to in the state of India.
   695   # to in the state of India.
    57   district = models.CharField(max_length=256,
   696   district = models.CharField(max_length=256,
    58                               choices=DISTRICT_CHOICES)
   697                               choices=sort_dict(DISTRICT_CHOICES))
       
   698   district.help_text = ('First select the state before selecting the district. '
       
   699       'Select the district of the state where this project is taken up.')
       
   700 
       
   701   mobile_num = models.CharField(max_length=20)
       
   702   mobile_num.help_text = 'Enter your mobile number.'
       
   703 
       
   704   fax_num = models.CharField(max_length=20, null=True, blank=True)
       
   705   fax_num.help_text = 'Enter your fax number with the code.'
    59 
   706 
    60   # Field containing the autogenerated MICR code for the project.
   707   # Field containing the autogenerated MICR code for the project.
    61   micr_code = models.CharField(max_length=15, unique=True)
   708   micr_code = models.CharField(max_length=15, unique=True)
    62 
   709 
    63   # Field containing the status of the project.
   710   # Field containing the status of the project.
    65   # New, Revised, Funded, Pilot, DPE
   712   # New, Revised, Funded, Pilot, DPE
    66   status = models.CharField(max_length=256,
   713   status = models.CharField(max_length=256,
    67                             choices=[('new', 'New'), ('pilot', 'Pilot'),
   714                             choices=[('new', 'New'), ('pilot', 'Pilot'),
    68                                      ('invalid', 'Invalid')])
   715                                      ('invalid', 'Invalid')])
    69 
   716 
       
   717   last_updated_on = models.DateTimeField(auto_now=True)
       
   718 
    70   @classmethod
   719   @classmethod
    71   def getLineItem(cls, code):
   720   def getLineItem(cls, code):
    72     """Get the State name from its code.
   721     """Get the State name from its code.
    73     """
   722     """
    74 
   723 
    75     line_item_dict = dict(cls.LINE_ITEM_CHOICES)
   724     return cls.LINE_ITEM_CHOICES[code]
    76     return line_item_dict[code]
       
    77 
   725 
    78   @classmethod
   726   @classmethod
    79   def getLineItemCode(cls, name):
   727   def getLineItemCode(cls, name):
    80     """Get the Line Item code from its name.
   728     """Get the Line Item code from its name.
    81     """
   729     """
    82 
   730 
    83     for ln_code, ln_name in cls.LINE_ITEM_CHOICES:
   731     for ln_code in cls.LINE_ITEM_CHOICES:
    84       if ln_name == name:
   732       if cls.LINE_ITEM_CHOICES[ln_code] == name:
    85         return ln_code
   733         return ln_code
    86 
   734 
    87     return None
   735     return None
    88 
   736 
    89   @classmethod
   737   @classmethod
    90   def getState(cls, code):
   738   def getState(cls, code):
    91     """Get the State code from its name.
   739     """Get the State code from its name.
    92     """
   740     """
    93 
   741 
    94     state_dict = dict(cls.STATE_CHOICES)
   742     return cls.STATE_CHOICES[code]
    95     return state_dict[code]
       
    96 
   743 
    97   @classmethod
   744   @classmethod
    98   def getStateCode(cls, name):
   745   def getStateCode(cls, name):
    99     """Get the State code from its name.
   746     """Get the State code from its name.
   100     """
   747     """
   101 
   748 
   102     for st_code, st_name in cls.STATE_CHOICES:
   749     for st_code in cls.STATE_CHOICES:
   103       if st_name == name:
   750       if cls.STATE_CHOICES[st_code] == name:
   104         return st_code
   751         return st_code
   105 
   752 
   106     return None
   753     return None
   107 
   754 
   108   @classmethod
   755   @classmethod
   109   def getDistrict(cls, code):
   756   def getDistrict(cls, code):
   110     """Get the District name from its code.
   757     """Get the District name from its code.
   111     """
   758     """
   112 
   759 
   113     district_dict = dict(cls.DISTRICT_CHOICES)
   760     return cls.DISTRICT_CHOICES[code]
   114     return district_dict[code]
       
   115 
   761 
   116   @classmethod
   762   @classmethod
   117   def getDistrictCode(cls, name):
   763   def getDistrictCode(cls, name):
   118     """Get the District code from its name.
   764     """Get the District code from its name.
   119     """
   765     """
   120 
   766 
   121     for dt_code, dt_name in cls.DISTRICT_CHOICES:
   767     for dt_code in cls.DISTRICT_CHOICES:
   122       if dt_name == name:
   768       if cls.DISTRICT_CHOICES[dt_code] == name:
   123         return dt_code
   769         return dt_code
   124 
   770 
   125     return None
   771     return None
   126 
   772 
   127 class Proposal(models.Model):
   773 class Proposal(models.Model):
   131   #: Field representing the relation to the corresponding project.
   777   #: Field representing the relation to the corresponding project.
   132   project = models.ForeignKey(Project)
   778   project = models.ForeignKey(Project)
   133  
   779  
   134   #: Field containing the Line Item to which the project belongs to.
   780   #: Field containing the Line Item to which the project belongs to.
   135   document = models.FileField(upload_to='proposals/%Y/%m/%d')
   781   document = models.FileField(upload_to='proposals/%Y/%m/%d')
       
   782   document.help_text = 'Select the document path from your local file system.'
   136 
   783 
   137   #: Field containing the date on which the document was submitted
   784   #: Field containing the date on which the document was submitted
   138   submitted_on = models.DateTimeField(auto_now_add=True)
   785   submitted_on = models.DateTimeField(auto_now_add=True)
   139 
   786 
   140   #: Field containing the reference to the user who submitted the proposal.
   787   #: Field containing the reference to the user who submitted the proposal.
   194   #: Field representing the relation to the corresponding project.
   841   #: Field representing the relation to the corresponding project.
   195   project = models.ForeignKey(Project)
   842   project = models.ForeignKey(Project)
   196 
   843 
   197   #: Field containing the comment entered along with the review.
   844   #: Field containing the comment entered along with the review.
   198   comment = models.TextField()
   845   comment = models.TextField()
       
   846   comment.help_text = "Enter your review comment about this proposal."
   199 
   847 
   200   #: Field representing the reference to the person who
   848   #: Field representing the reference to the person who
   201   #: did the review.
   849   #: did the review.
   202   reviewer = models.ForeignKey(User, null=True)
   850   reviewer = models.ForeignKey(User, null=True)
   203 
   851 
   204   #: Field containing the date and time of review of the proposal.
   852   #: Field containing the date and time of review of the proposal.
   205   reviewed_on = models.DateTimeField(auto_now_add=True)
   853   reviewed_on = models.DateTimeField(auto_now=True)
   206 
   854 
   207   #: Field containing the review value for this attribute.
   855   #: Field containing the review value for this attribute.
   208   attribute1 = models.PositiveSmallIntegerField(
   856   attribute1 = models.PositiveSmallIntegerField(
   209       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   857       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   858   attribute1.verbose_name = ''
   210   
   859   
   211   attribute2 = models.PositiveSmallIntegerField(
   860   attribute2 = models.PositiveSmallIntegerField(
   212       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   861       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   862   attribute1.verbose_name = ''
   213 
   863 
   214   attribute3 = models.PositiveSmallIntegerField(
   864   attribute3 = models.PositiveSmallIntegerField(
   215       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   865       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   866   attribute1.verbose_name = ''
   216 
   867 
   217   attribute4 = models.PositiveSmallIntegerField(
   868   attribute4 = models.PositiveSmallIntegerField(
   218       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   869       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   870   attribute1.verbose_name = ''
   219 
   871 
   220   attribute5 = models.PositiveSmallIntegerField(
   872   attribute5 = models.PositiveSmallIntegerField(
   221       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   873       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   874   attribute1.verbose_name = ''
   222 
   875 
   223   attribute6 = models.PositiveSmallIntegerField(
   876   attribute6 = models.PositiveSmallIntegerField(
   224       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   877       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   878   attribute1.verbose_name = ''
   225 
   879 
   226   attribute7 = models.PositiveSmallIntegerField(
   880   attribute7 = models.PositiveSmallIntegerField(
   227       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   881       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   882   attribute1.verbose_name = ''
   228 
   883 
   229   attribute8 = models.PositiveSmallIntegerField(
   884   attribute8 = models.PositiveSmallIntegerField(
   230       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   885       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   886   attribute1.verbose_name = ''
   231 
   887 
   232   attribute9 = models.PositiveSmallIntegerField(
   888   attribute9 = models.PositiveSmallIntegerField(
   233       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   889       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
       
   890   attribute1.verbose_name = ''