From 0de840c6018da11bda8b43609cd8f71db99c0b3d Mon Sep 17 00:00:00 2001 From: Pasi Eronen Date: Mon, 9 Nov 2009 09:11:44 +0000 Subject: [PATCH] Run convert-096.py - Legacy-Id: 1851 --- ietf/announcements/models.py | 44 ++++--- ietf/idindex/forms.py | 4 +- ietf/idrfc/models.py | 28 ++-- ietf/idrfc/views_search.py | 21 +-- ietf/idtracker/forms.py | 4 +- ietf/idtracker/models.py | 247 ++++++++++++++++++----------------- ietf/idtracker/views.py | 4 +- ietf/iesg/models.py | 6 +- ietf/ietfauth/auth.py | 4 +- ietf/ietfauth/models.py | 29 ++-- ietf/ipr/models.py | 69 +++++----- ietf/ipr/new.py | 29 ++-- ietf/liaisons/models.py | 58 ++++---- ietf/mailinglists/models.py | 24 ++-- ietf/proceedings/models.py | 68 +++++----- ietf/redirects/models.py | 22 ++-- 16 files changed, 359 insertions(+), 302 deletions(-) diff --git a/ietf/announcements/models.py b/ietf/announcements/models.py index 6c2899078..f51b53880 100644 --- a/ietf/announcements/models.py +++ b/ietf/announcements/models.py @@ -11,9 +11,9 @@ from ietf.idtracker.models import PersonOrOrgInfo, ChairsHistory # email is not used; the announced_from text is Foo Bar class AnnouncedFrom(models.Model): announced_from_id = models.AutoField(primary_key=True) - announced_from = models.CharField(blank=True, maxlength=255, db_column='announced_from_value') - email = models.CharField(blank=True, maxlength=255, db_column='announced_from_email', editable=False) - #permission = models.ManyToManyField(Permission, limit_choices_to={'codename__endswith':'announcedfromperm'}, filter_interface=models.VERTICAL, verbose_name='Permission Required', blank=True) + announced_from = models.CharField(blank=True, max_length=255, db_column='announced_from_value') + email = models.CharField(blank=True, max_length=255, db_column='announced_from_email', editable=False) + #permission = models.ManyToManyField(Permission, limit_choices_to={'codename__endswith':'announcedfromperm'}, verbose_name='Permission Required', blank=True) def __str__(self): return self.announced_from class Meta: @@ -30,8 +30,8 @@ class AnnouncedFrom(models.Model): class AnnouncedTo(models.Model): announced_to_id = models.AutoField(primary_key=True) - announced_to = models.CharField(blank=True, maxlength=255, db_column='announced_to_value') - email = models.CharField(blank=True, maxlength=255, db_column='announced_to_email') + announced_to = models.CharField(blank=True, max_length=255, db_column='announced_to_value') + email = models.CharField(blank=True, max_length=255, db_column='announced_to_email') def __str__(self): return self.announced_to class Meta: @@ -41,19 +41,19 @@ class AnnouncedTo(models.Model): class Announcement(models.Model): announcement_id = models.AutoField(primary_key=True) - announced_by = models.ForeignKey(PersonOrOrgInfo, raw_id_admin=True, db_column='announced_by') + announced_by = models.ForeignKey(PersonOrOrgInfo, db_column='announced_by') announced_date = models.DateField(null=True, blank=True) - announced_time = models.CharField(blank=True, maxlength=20) + announced_time = models.CharField(blank=True, max_length=20) text = models.TextField(blank=True, db_column='announcement_text') announced_from = models.ForeignKey(AnnouncedFrom) - cc = models.CharField(blank=True, maxlength=255) - subject = models.CharField(blank=True, maxlength=255) + cc = models.CharField(blank=True, max_length=255) + subject = models.CharField(blank=True, max_length=255) extra = models.TextField(blank=True) announced_to = models.ForeignKey(AnnouncedTo) nomcom = models.BooleanField() nomcom_chair = models.ForeignKey(ChairsHistory, null=True, blank=True) manually_added = models.BooleanField(db_column='manualy_added') - other_val = models.CharField(blank=True, maxlength=255) + other_val = models.CharField(blank=True, max_length=255) def __str__(self): return "Announcement from %s to %s on %s %s" % (self.announced_from, self.announced_to, self.announced_date, self.announced_time) def from_name(self): @@ -73,26 +73,30 @@ class Announcement(models.Model): class ScheduledAnnouncement(models.Model): mail_sent = models.BooleanField() to_be_sent_date = models.DateField(null=True, blank=True) - to_be_sent_time = models.CharField(blank=True, maxlength=50) - scheduled_by = models.CharField(blank=True, maxlength=100) + to_be_sent_time = models.CharField(blank=True, max_length=50) + scheduled_by = models.CharField(blank=True, max_length=100) scheduled_date = models.DateField(null=True, blank=True) - scheduled_time = models.CharField(blank=True, maxlength=50) - subject = models.CharField(blank=True, maxlength=255) - to_val = models.CharField(blank=True, maxlength=255) - from_val = models.CharField(blank=True, maxlength=255) + scheduled_time = models.CharField(blank=True, max_length=50) + subject = models.CharField(blank=True, max_length=255) + to_val = models.CharField(blank=True, max_length=255) + from_val = models.CharField(blank=True, max_length=255) cc_val = models.TextField(blank=True) body = models.TextField(blank=True) actual_sent_date = models.DateField(null=True, blank=True) - actual_sent_time = models.CharField(blank=True, maxlength=50) + actual_sent_time = models.CharField(blank=True, max_length=50) first_q = models.IntegerField(null=True, blank=True) second_q = models.IntegerField(null=True, blank=True) note = models.TextField(blank=True) - content_type = models.CharField(blank=True, maxlength=255) - replyto = models.CharField(blank=True, maxlength=255) - bcc_val = models.CharField(blank=True, maxlength=255) + content_type = models.CharField(blank=True, max_length=255) + replyto = models.CharField(blank=True, max_length=255) + bcc_val = models.CharField(blank=True, max_length=255) def __str__(self): return "Scheduled Announcement from %s to %s on %s %s" % (self.from_val, self.to_val, self.to_be_sent_date, self.to_be_sent_time) class Meta: db_table = 'scheduled_announcements' class Admin: pass + +# changes done by convert-096.py:changed maxlength to max_length +# removed filter_interface +# removed raw_id_admin diff --git a/ietf/idindex/forms.py b/ietf/idindex/forms.py index 3c875d5f1..5f7d8f54a 100644 --- a/ietf/idindex/forms.py +++ b/ietf/idindex/forms.py @@ -1,6 +1,6 @@ # Copyright The IETF Trust 2007, All Rights Reserved -from django import newforms as forms +from django import forms from ietf.idtracker.models import IDState, IDStatus, IETFWG from ietf.idindex.models import orgs @@ -17,3 +17,5 @@ class IDIndexSearchForm(forms.Form): self.fields['id_tracker_state_id'].choices = [('', 'All/Any')] + IDState.choices() self.fields['wg_id'].choices = [('', 'All/Any')] + IETFWG.choices() self.fields['status_id'].choices = [('', 'All/Any')] + [(status.status_id, status.status) for status in IDStatus.objects.all()] + +# changes done by convert-096.py:changed newforms to forms diff --git a/ietf/idrfc/models.py b/ietf/idrfc/models.py index d352af65f..7a009b823 100644 --- a/ietf/idrfc/models.py +++ b/ietf/idrfc/models.py @@ -43,7 +43,7 @@ class RfcEditorQueue(models.Model): ) draft = models.OneToOneField(InternetDraft, db_column="id_document_tag", related_name="rfc_editor_queue_state",primary_key=True) date_received = models.DateField() - state = models.CharField(maxlength=200, blank=True, null=True) + state = models.CharField(max_length=200, blank=True, null=True) # currently, queue2.xml does not have this information, so # this field will be NULL (but we could get it from other sources) state_date = models.DateField(blank=True,null=True) @@ -57,7 +57,7 @@ class RfcEditorQueue(models.Model): class RfcEditorQueueRef(models.Model): source = models.ForeignKey(InternetDraft, db_column="source", related_name="rfc_editor_queue_refs") - destination = models.CharField(maxlength=200) + destination = models.CharField(max_length=200) in_queue = models.BooleanField() direct = models.BooleanField() class Meta: @@ -67,16 +67,16 @@ class RfcEditorQueueRef(models.Model): class RfcIndex(models.Model): rfc_number = models.IntegerField(primary_key=True) - title = models.CharField(maxlength=250) - authors = models.CharField(maxlength=250) + title = models.CharField(max_length=250) + authors = models.CharField(max_length=250) rfc_published_date = models.DateField() - current_status = models.CharField(maxlength=50,null=True) - updates = models.CharField(maxlength=200,blank=True,null=True) - updated_by = models.CharField(maxlength=200,blank=True,null=True) - obsoletes = models.CharField(maxlength=200,blank=True,null=True) - obsoleted_by = models.CharField(maxlength=200,blank=True,null=True) - also = models.CharField(maxlength=50,blank=True,null=True) - draft = models.CharField(maxlength=200,null=True) + current_status = models.CharField(max_length=50,null=True) + updates = models.CharField(max_length=200,blank=True,null=True) + updated_by = models.CharField(max_length=200,blank=True,null=True) + obsoletes = models.CharField(max_length=200,blank=True,null=True) + obsoleted_by = models.CharField(max_length=200,blank=True,null=True) + also = models.CharField(max_length=50,blank=True,null=True) + draft = models.CharField(max_length=200,null=True) has_errata = models.BooleanField() def __str__(self): return "RfcIndex"+str(self.rfc_number) @@ -90,8 +90,8 @@ class DraftVersions(models.Model): # we can't use filename+revision. But the key for this table # does not really matter, so we'll have an 'id' field id = models.AutoField(primary_key=True) - filename = models.CharField(maxlength=200, db_index=True) - revision = models.CharField(maxlength=2) + filename = models.CharField(max_length=200, db_index=True) + revision = models.CharField(max_length=2) revision_date = models.DateField() def __str__(self): return "DraftVersions"+self.filename+self.revision+str(self.revision_date) @@ -100,3 +100,5 @@ class DraftVersions(models.Model): class Admin: pass + +# changes done by convert-096.py:changed maxlength to max_length diff --git a/ietf/idrfc/views_search.py b/ietf/idrfc/views_search.py index 46aa99ff7..c80552acf 100644 --- a/ietf/idrfc/views_search.py +++ b/ietf/idrfc/views_search.py @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import re -from django import newforms as forms +from django import forms from django.shortcuts import render_to_response from django.db.models import Q from django.template import RequestContext @@ -57,7 +57,7 @@ class SearchForm(forms.Form): subState = forms.ChoiceField(choices=(), required=False) def clean_name(self): - value = self.clean_data.get('name','') + value = self.cleaned_data.get('name','') return normalize_draftname(value) def __init__(self, *args, **kwargs): super(SearchForm, self).__init__(*args, **kwargs) @@ -213,8 +213,8 @@ def search_results(request): form = SearchForm(request.REQUEST) if not form.is_valid(): return HttpResponse("form not valid?", mimetype="text/plain") - x = form.clean_data - (results,meta) = search_query(form.clean_data) + x = form.cleaned_data + (results,meta) = search_query(form.cleaned_data) if 'ajax' in request.REQUEST and request.REQUEST['ajax']: return render_to_response('idrfc/search_results.html', {'docs':results, 'meta':meta}, context_instance=RequestContext(request)) else: @@ -239,13 +239,16 @@ def by_ad(request, name): form = SearchForm(request.REQUEST) if form.is_valid(): pass - form.clean_data['ad'] = ad_id - form.clean_data['activeDrafts'] = True - form.clean_data['rfcs'] = True - form.clean_data['oldDrafts'] = True - (results,meta) = search_query(form.clean_data) + form.cleaned_data['ad'] = ad_id + form.cleaned_data['activeDrafts'] = True + form.cleaned_data['rfcs'] = True + form.cleaned_data['oldDrafts'] = True + (results,meta) = search_query(form.cleaned_data) results.sort(key=lambda obj: obj.view_sort_key_byad()) return render_to_response('idrfc/by_ad.html', {'form':form, 'docs':results,'meta':meta, 'ad_name':ad_name}, context_instance=RequestContext(request)) + +# changes done by convert-096.py:changed newforms to forms +# cleaned_data diff --git a/ietf/idtracker/forms.py b/ietf/idtracker/forms.py index 28a052d38..15ad445ed 100644 --- a/ietf/idtracker/forms.py +++ b/ietf/idtracker/forms.py @@ -1,6 +1,6 @@ # Copyright The IETF Trust 2007, All Rights Reserved -from django import newforms as forms +from django import forms from models import IESGLogin, IDStatus, Area, IDState, IDSubState class IDSearch(forms.Form): @@ -17,3 +17,5 @@ class IDSearch(forms.Form): self.fields['search_job_owner'].choices = [('', '--All/Any')] + [(ad.id, "%s, %s" % (ad.last_name, ad.first_name)) for ad in IESGLogin.objects.filter(user_level=1).order_by('last_name')] + [('-99', '------------------')] + [(ad.id, "%s, %s" % (ad.last_name, ad.first_name)) for ad in IESGLogin.objects.filter(user_level=2).order_by('last_name')] self.fields['sub_state_id'].choices = [('', '--All Substates'), ('0', 'None')] + [(state.sub_state_id, state.sub_state) for state in IDSubState.objects.all()] + +# changes done by convert-096.py:changed newforms to forms diff --git a/ietf/idtracker/models.py b/ietf/idtracker/models.py index d28902d74..12d3bbd1b 100644 --- a/ietf/idtracker/models.py +++ b/ietf/idtracker/models.py @@ -10,9 +10,9 @@ from ietf.utils import FKAsOneToOne class Acronym(models.Model): acronym_id = models.AutoField(primary_key=True) - acronym = models.CharField(maxlength=12) - name = models.CharField(maxlength=100) - name_key = models.CharField(maxlength=50, editable=False) + acronym = models.CharField(max_length=12) + name = models.CharField(max_length=100) + name_key = models.CharField(max_length=50, editable=False) def save(self): self.name_key = self.name.upper() super(Acronym, self).save() @@ -26,7 +26,7 @@ class Acronym(models.Model): class AreaStatus(models.Model): status_id = models.AutoField(primary_key=True) - status = models.CharField(maxlength=25, db_column='status_value') + status = models.CharField(max_length=25, db_column='status_value') def __str__(self): return self.status class Meta: @@ -37,7 +37,7 @@ class AreaStatus(models.Model): # I think equiv_group_flag is historical. class IDState(models.Model): document_state_id = models.AutoField(primary_key=True) - state = models.CharField(maxlength=50, db_column='document_state_val') + state = models.CharField(max_length=50, db_column='document_state_val') equiv_group_flag = models.IntegerField(null=True, blank=True) description = models.TextField(blank=True, db_column='document_desc') def __str__(self): @@ -53,8 +53,8 @@ class IDState(models.Model): class IDNextState(models.Model): cur_state = models.ForeignKey(IDState, related_name='nextstate') - next_state = models.ForeignKey(IDState, related_name='prevstate', core=True) - condition = models.CharField(blank=True, maxlength=255) + next_state = models.ForeignKey(IDState, related_name='prevstate') + condition = models.CharField(blank=True, max_length=255) def __str__(self): return "%s -> %s" % (self.cur_state.state, self.next_state.state ) class Meta: @@ -64,7 +64,7 @@ class IDNextState(models.Model): class IDSubState(models.Model): sub_state_id = models.AutoField(primary_key=True) - sub_state = models.CharField(maxlength=55, db_column='sub_state_val') + sub_state = models.CharField(max_length=55, db_column='sub_state_val') description = models.TextField(blank=True, db_column='sub_state_desc') def __str__(self): return self.sub_state @@ -96,9 +96,9 @@ class Area(models.Model): pass class AreaURL(models.Model): - area = models.ForeignKey(Area, edit_inline=models.STACKED, num_in_admin=1, null=True, related_name='urls') - url = models.URLField(maxlength=255, db_column='url_value', core=True) - url_label = models.CharField(maxlength=255, db_column='url_label') + area = models.ForeignKey(Area, null=True, related_name='urls') + url = models.URLField(max_length=255, db_column='url_value') + url_label = models.CharField(max_length=255, db_column='url_label') def __str__(self): return self.url class Admin: @@ -106,7 +106,7 @@ class AreaURL(models.Model): class IDStatus(models.Model): status_id = models.AutoField(primary_key=True) - status = models.CharField(maxlength=25, db_column='status_value') + status = models.CharField(max_length=25, db_column='status_value') def __str__(self): return self.status class Meta: @@ -118,7 +118,7 @@ class IDStatus(models.Model): class IDIntendedStatus(models.Model): intended_status_id = models.AutoField(primary_key=True) - intended_status = models.CharField(maxlength=25, db_column='status_value') + intended_status = models.CharField(max_length=25, db_column='status_value') def __str__(self): return self.intended_status class Meta: @@ -131,15 +131,15 @@ class IDIntendedStatus(models.Model): class InternetDraft(models.Model): DAYS_TO_EXPIRE=185 id_document_tag = models.AutoField(primary_key=True) - title = models.CharField(maxlength=255, db_column='id_document_name') - id_document_key = models.CharField(maxlength=255, editable=False) + title = models.CharField(max_length=255, db_column='id_document_name') + id_document_key = models.CharField(max_length=255, editable=False) group = models.ForeignKey(Acronym, db_column='group_acronym_id') - filename = models.CharField(maxlength=255, unique=True) - revision = models.CharField(maxlength=2) + filename = models.CharField(max_length=255, unique=True) + revision = models.CharField(max_length=2) revision_date = models.DateField() - file_type = models.CharField(maxlength=20) + file_type = models.CharField(max_length=20) txt_page_count = models.IntegerField() - local_path = models.CharField(maxlength=255, blank=True) + local_path = models.CharField(max_length=255, blank=True) start_date = models.DateField() expiration_date = models.DateField() abstract = models.TextField() @@ -148,7 +148,7 @@ class InternetDraft(models.Model): status = models.ForeignKey(IDStatus) intended_status = models.ForeignKey(IDIntendedStatus) lc_sent_date = models.DateField(null=True, blank=True) - lc_changes = models.CharField(maxlength=3) + lc_changes = models.CharField(max_length=3) lc_expiration_date = models.DateField(null=True, blank=True) b_sent_date = models.DateField(null=True, blank=True) b_discussion_date = models.DateField(null=True, blank=True) @@ -157,7 +157,7 @@ class InternetDraft(models.Model): rfc_number = models.IntegerField(null=True, blank=True, db_index=True) comments = models.TextField(blank=True) last_modified_date = models.DateField() - replaced_by = models.ForeignKey('self', db_column='replaced_by', raw_id_admin=True, blank=True, null=True, related_name='replaces_set') + replaced_by = models.ForeignKey('self', db_column='replaced_by', blank=True, null=True, related_name='replaces_set') replaces = FKAsOneToOne('replaces', reverse=True) review_by_rfc_editor = models.BooleanField() expired_tombstone = models.BooleanField() @@ -256,20 +256,20 @@ class InternetDraft(models.Model): class PersonOrOrgInfo(models.Model): person_or_org_tag = models.AutoField(primary_key=True) - record_type = models.CharField(blank=True, maxlength=8) - name_prefix = models.CharField(blank=True, maxlength=10) - first_name = models.CharField(blank=True, maxlength=20) - first_name_key = models.CharField(blank=True, maxlength=20, editable=False) - middle_initial = models.CharField(blank=True, maxlength=4) - middle_initial_key = models.CharField(blank=True, maxlength=4, editable=False) - last_name = models.CharField(blank=True, maxlength=50) - last_name_key = models.CharField(blank=True, maxlength=50, editable=False) - name_suffix = models.CharField(blank=True, maxlength=10) + record_type = models.CharField(blank=True, max_length=8) + name_prefix = models.CharField(blank=True, max_length=10) + first_name = models.CharField(blank=True, max_length=20) + first_name_key = models.CharField(blank=True, max_length=20, editable=False) + middle_initial = models.CharField(blank=True, max_length=4) + middle_initial_key = models.CharField(blank=True, max_length=4, editable=False) + last_name = models.CharField(blank=True, max_length=50) + last_name_key = models.CharField(blank=True, max_length=50, editable=False) + name_suffix = models.CharField(blank=True, max_length=10) date_modified = models.DateField(null=True, blank=True, auto_now=True) - modified_by = models.CharField(blank=True, maxlength=8) + modified_by = models.CharField(blank=True, max_length=8) date_created = models.DateField(auto_now_add=True) - created_by = models.CharField(blank=True, maxlength=8) - address_type = models.CharField(blank=True, maxlength=4) + created_by = models.CharField(blank=True, max_length=8) + address_type = models.CharField(blank=True, max_length=4) def save(self): self.first_name_key = self.first_name.upper() self.middle_initial_key = self.middle_initial.upper() @@ -328,13 +328,13 @@ class IESGLogin(models.Model): (4, 'Comment Only(?)'), ) id = models.AutoField(primary_key=True) - login_name = models.CharField(blank=True, maxlength=255) - password = models.CharField(maxlength=25) + login_name = models.CharField(blank=True, max_length=255) + password = models.CharField(max_length=25) user_level = models.IntegerField(choices=USER_LEVEL_CHOICES) - first_name = models.CharField(blank=True, maxlength=25) - last_name = models.CharField(blank=True, maxlength=25) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, unique=True) - pgp_id = models.CharField(blank=True, maxlength=20) + first_name = models.CharField(blank=True, max_length=25) + last_name = models.CharField(blank=True, max_length=25) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', unique=True) + pgp_id = models.CharField(blank=True, max_length=20) default_search = models.IntegerField(null=True) def __str__(self): #return "%s, %s" % ( self.last_name, self.first_name) @@ -352,8 +352,8 @@ class IESGLogin(models.Model): pass class AreaDirector(models.Model): - area = models.ForeignKey(Area, db_column='area_acronym_id', edit_inline=models.STACKED, num_in_admin=2, null=True) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, core=True) + area = models.ForeignKey(Area, db_column='area_acronym_id', null=True) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') def __str__(self): return "%s (%s)" % ( self.person, self.role() ) def role(self): @@ -372,7 +372,7 @@ class AreaDirector(models.Model): class RfcIntendedStatus(models.Model): NONE=5 intended_status_id = models.AutoField(primary_key=True) - status = models.CharField(maxlength=25, db_column='status_value') + status = models.CharField(max_length=25, db_column='status_value') def __str__(self): return self.status class Meta: @@ -383,7 +383,7 @@ class RfcIntendedStatus(models.Model): class RfcStatus(models.Model): status_id = models.AutoField(primary_key=True) - status = models.CharField(maxlength=25, db_column='status_value') + status = models.CharField(max_length=25, db_column='status_value') def __str__(self): return self.status class Meta: @@ -396,16 +396,16 @@ class RfcStatus(models.Model): class Rfc(models.Model): ONLINE_CHOICES=(('YES', 'Yes'), ('NO', 'No')) rfc_number = models.IntegerField(primary_key=True) - title = models.CharField(maxlength=200, db_column='rfc_name') - rfc_name_key = models.CharField(maxlength=200, editable=False) - group_acronym = models.CharField(blank=True, maxlength=8) - area_acronym = models.CharField(blank=True, maxlength=8) + title = models.CharField(max_length=200, db_column='rfc_name') + rfc_name_key = models.CharField(max_length=200, editable=False) + group_acronym = models.CharField(blank=True, max_length=8) + area_acronym = models.CharField(blank=True, max_length=8) status = models.ForeignKey(RfcStatus, db_column="status_id") intended_status = models.ForeignKey(RfcIntendedStatus, db_column="intended_status_id", default=RfcIntendedStatus.NONE) - fyi_number = models.CharField(blank=True, maxlength=20) - std_number = models.CharField(blank=True, maxlength=20) + fyi_number = models.CharField(blank=True, max_length=20) + std_number = models.CharField(blank=True, max_length=20) txt_page_count = models.IntegerField(null=True, blank=True) - online_version = models.CharField(choices=ONLINE_CHOICES, maxlength=3, default='YES') + online_version = models.CharField(choices=ONLINE_CHOICES, max_length=3, default='YES') rfc_published_date = models.DateField(null=True, blank=True) proposed_date = models.DateField(null=True, blank=True) draft_date = models.DateField(null=True, blank=True) @@ -484,8 +484,8 @@ class Rfc(models.Model): })) class RfcAuthor(models.Model): - rfc = models.ForeignKey(Rfc, unique=True, db_column='rfc_number', related_name='authors', edit_inline=models.TABULAR) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, core=True) + rfc = models.ForeignKey(Rfc, unique=True, db_column='rfc_number', related_name='authors') + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') def __str__(self): return "%s, %s" % ( self.person.last_name, self.person.first_name) class Meta: @@ -493,9 +493,9 @@ class RfcAuthor(models.Model): verbose_name = 'RFC Author' class RfcObsolete(models.Model): - rfc = models.ForeignKey(Rfc, db_column='rfc_number', raw_id_admin=True, related_name='updates_or_obsoletes') - action = models.CharField(maxlength=20, core=True) - rfc_acted_on = models.ForeignKey(Rfc, db_column='rfc_acted_on', raw_id_admin=True, related_name='updated_or_obsoleted_by') + rfc = models.ForeignKey(Rfc, db_column='rfc_number', related_name='updates_or_obsoletes') + action = models.CharField(max_length=20) + rfc_acted_on = models.ForeignKey(Rfc, db_column='rfc_acted_on', related_name='updated_or_obsoleted_by') def __str__(self): return "RFC%04d %s RFC%04d" % (self.rfc_id, self.action, self.rfc_acted_on_id) class Meta: @@ -575,15 +575,15 @@ class IDInternal(models.Model): ballot = models.ForeignKey(BallotInfo, related_name='drafts', db_column="ballot_id") primary_flag = models.IntegerField(blank=True, null=True) group_flag = models.IntegerField(blank=True) - token_name = models.CharField(blank=True, maxlength=25) - token_email = models.CharField(blank=True, maxlength=255) + token_name = models.CharField(blank=True, max_length=25) + token_email = models.CharField(blank=True, max_length=255) note = models.TextField(blank=True) status_date = models.DateField(null=True) - email_display = models.CharField(blank=True, maxlength=50) + email_display = models.CharField(blank=True, max_length=50) agenda = models.IntegerField(null=True, blank=True) cur_state = models.ForeignKey(IDState, db_column='cur_state', related_name='docs') prev_state = models.ForeignKey(IDState, db_column='prev_state', related_name='docs_prev') - assigned_to = models.CharField(blank=True, maxlength=25) + assigned_to = models.CharField(blank=True, max_length=25) mark_by = models.ForeignKey(IESGLogin, db_column='mark_by', related_name='marked') job_owner = models.ForeignKey(IESGLogin, db_column='job_owner', related_name='documents') event_date = models.DateField(null=True) @@ -593,7 +593,7 @@ class IDInternal(models.Model): returning_item = models.IntegerField(null=True, blank=True) telechat_date = models.DateField(null=True, blank=True) via_rfc_editor = models.IntegerField(null=True, blank=True) - state_change_notice_to = models.CharField(blank=True, maxlength=255) + state_change_notice_to = models.CharField(blank=True, max_length=255) dnp = models.IntegerField(null=True, blank=True) dnp_date = models.DateField(null=True, blank=True) noproblem = models.IntegerField(null=True, blank=True) @@ -656,8 +656,8 @@ class DocumentComment(models.Model): rfc_flag = models.IntegerField(null=True, blank=True) public_flag = models.IntegerField() date = models.DateField(db_column='comment_date') - time = models.CharField(db_column='comment_time', maxlength=20) - version = models.CharField(blank=True, maxlength=3) + time = models.CharField(db_column='comment_time', max_length=20) + version = models.CharField(blank=True, max_length=3) comment_text = models.TextField(blank=True) created_by = models.ForeignKey(IESGLogin, db_column='created_by', null=True) result_state = models.ForeignKey(IDState, db_column='result_state', null=True, related_name="comments_leading_to_state") @@ -693,8 +693,8 @@ class DocumentComment(models.Model): db_table = 'document_comments' class Position(models.Model): - ballot = models.ForeignKey(BallotInfo, raw_id_admin=True, related_name='positions') - ad = models.ForeignKey(IESGLogin, raw_id_admin=True) + ballot = models.ForeignKey(BallotInfo, related_name='positions') + ad = models.ForeignKey(IESGLogin) yes = models.IntegerField(db_column='yes_col') noobj = models.IntegerField(db_column='no_col') abstain = models.IntegerField() @@ -718,10 +718,10 @@ class Position(models.Model): pass class IESGComment(models.Model): - ballot = models.ForeignKey(BallotInfo, raw_id_admin=True, related_name="comments") - ad = models.ForeignKey(IESGLogin, raw_id_admin=True) + ballot = models.ForeignKey(BallotInfo, related_name="comments") + ad = models.ForeignKey(IESGLogin) date = models.DateField(db_column="comment_date") - revision = models.CharField(maxlength=2) + revision = models.CharField(max_length=2) active = models.IntegerField() text = models.TextField(blank=True, db_column="comment_text") def __str__(self): @@ -737,10 +737,10 @@ class IESGComment(models.Model): pass class IESGDiscuss(models.Model): - ballot = models.ForeignKey(BallotInfo, raw_id_admin=True, related_name="discusses") - ad = models.ForeignKey(IESGLogin, raw_id_admin=True) + ballot = models.ForeignKey(BallotInfo, related_name="discusses") + ad = models.ForeignKey(IESGLogin) date = models.DateField(db_column="discuss_date") - revision = models.CharField(maxlength=2) + revision = models.CharField(max_length=2) active = models.IntegerField() text = models.TextField(blank=True, db_column="discuss_text") def __str__(self): @@ -756,8 +756,8 @@ class IESGDiscuss(models.Model): pass class IDAuthor(models.Model): - document = models.ForeignKey(InternetDraft, db_column='id_document_tag', related_name='authors', edit_inline=models.TABULAR, raw_id_admin=True) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, core=True) + document = models.ForeignKey(InternetDraft, db_column='id_document_tag', related_name='authors') + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') author_order = models.IntegerField() def __str__(self): return "%s authors %s" % ( self.person, self.document.filename ) @@ -785,20 +785,20 @@ class IDAuthor(models.Model): # to be fixed by moving admin to newforms. # must decide which field is/are core. class PostalAddress(models.Model): - address_type = models.CharField(maxlength=4) + address_type = models.CharField(max_length=4) address_priority = models.IntegerField(null=True) - person_or_org = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', edit_inline=models.STACKED, num_in_admin=1) - person_title = models.CharField(maxlength=50, blank=True) - affiliated_company = models.CharField(maxlength=70, blank=True) - aff_company_key = models.CharField(maxlength=70, blank=True, editable=False) - department = models.CharField(maxlength=100, blank=True) - staddr1 = models.CharField(maxlength=40, core=True) - staddr2 = models.CharField(maxlength=40, blank=True) - mail_stop = models.CharField(maxlength=20, blank=True) - city = models.CharField(maxlength=20, blank=True) - state_or_prov = models.CharField(maxlength=20, blank=True) - postal_code = models.CharField(maxlength=20, blank=True) - country = models.CharField(maxlength=20, blank=True) + person_or_org = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') + person_title = models.CharField(max_length=50, blank=True) + affiliated_company = models.CharField(max_length=70, blank=True) + aff_company_key = models.CharField(max_length=70, blank=True, editable=False) + department = models.CharField(max_length=100, blank=True) + staddr1 = models.CharField(max_length=40) + staddr2 = models.CharField(max_length=40, blank=True) + mail_stop = models.CharField(max_length=20, blank=True) + city = models.CharField(max_length=20, blank=True) + state_or_prov = models.CharField(max_length=20, blank=True) + postal_code = models.CharField(max_length=20, blank=True) + country = models.CharField(max_length=20, blank=True) def save(self): self.aff_company_key = self.affiliated_company.upper() super(PostalAddress, self).save() @@ -808,11 +808,11 @@ class PostalAddress(models.Model): verbose_name_plural = 'Postal Addresses' class EmailAddress(models.Model): - person_or_org = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', edit_inline=models.TABULAR, num_in_admin=1) - type = models.CharField(maxlength=4, db_column='email_type') + person_or_org = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') + type = models.CharField(max_length=4, db_column='email_type') priority = models.IntegerField(db_column='email_priority') - address = models.CharField(maxlength=255, core=True, db_column='email_address') - comment = models.CharField(blank=True, maxlength=255, db_column='email_comment') + address = models.CharField(max_length=255, db_column='email_address') + comment = models.CharField(blank=True, max_length=255, db_column='email_comment') def __str__(self): return self.address class Meta: @@ -827,11 +827,11 @@ class EmailAddress(models.Model): list_display = ( 'person_or_org', 'address', 'type', 'priority' ) class PhoneNumber(models.Model): - person_or_org = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', edit_inline=models.TABULAR, num_in_admin=1) - phone_type = models.CharField(maxlength=3) + person_or_org = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') + phone_type = models.CharField(max_length=3) phone_priority = models.IntegerField() - phone_number = models.CharField(blank=True, maxlength=255, core=True) - phone_comment = models.CharField(blank=True, maxlength=255) + phone_number = models.CharField(blank=True, max_length=255) + phone_comment = models.CharField(blank=True, max_length=255) class Meta: db_table = 'phone_numbers' #unique_together = (('phone_priority', 'person_or_org'), ) @@ -840,7 +840,7 @@ class PhoneNumber(models.Model): class WGType(models.Model): group_type_id = models.AutoField(primary_key=True) - type = models.CharField(maxlength=25, db_column='group_type') + type = models.CharField(max_length=25, db_column='group_type') def __str__(self): return self.type class Meta: @@ -850,7 +850,7 @@ class WGType(models.Model): class WGStatus(models.Model): status_id = models.AutoField(primary_key=True) - status = models.CharField(maxlength=25, db_column='status_value') + status = models.CharField(max_length=25, db_column='status_value') def __str__(self): return self.status class Meta: @@ -868,14 +868,14 @@ class IETFWG(models.Model): concluded_date = models.DateField(null=True, blank=True) status = models.ForeignKey(WGStatus) area_director = models.ForeignKey(AreaDirector, null=True) - meeting_scheduled = models.CharField(blank=True, maxlength=3) - email_address = models.CharField(blank=True, maxlength=60) - email_subscribe = models.CharField(blank=True, maxlength=120) - email_keyword = models.CharField(blank=True, maxlength=50) - email_archive = models.CharField(blank=True, maxlength=95) + meeting_scheduled = models.CharField(blank=True, max_length=3) + email_address = models.CharField(blank=True, max_length=60) + email_subscribe = models.CharField(blank=True, max_length=120) + email_keyword = models.CharField(blank=True, max_length=50) + email_archive = models.CharField(blank=True, max_length=95) comments = models.TextField(blank=True) last_modified_date = models.DateField() - meeting_scheduled_old = models.CharField(blank=True, maxlength=3) + meeting_scheduled_old = models.CharField(blank=True, max_length=3) area = FKAsOneToOne('areagroup', reverse=True) def __str__(self): return self.group_acronym.acronym @@ -930,8 +930,8 @@ class IETFWG(models.Model): #list_filter = ['status', 'group_type', 'area_director'] class WGChair(models.Model): - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, unique=True, core=True) - group_acronym = models.ForeignKey(IETFWG, edit_inline=models.TABULAR) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', unique=True) + group_acronym = models.ForeignKey(IETFWG) def __str__(self): return "%s (%s)" % ( self.person, self.role() ) def role(self): @@ -941,8 +941,8 @@ class WGChair(models.Model): verbose_name = "WG Chair" class WGEditor(models.Model): - group_acronym = models.ForeignKey(IETFWG, edit_inline=models.TABULAR) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, unique=True, core=True) + group_acronym = models.ForeignKey(IETFWG) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', unique=True) class Meta: db_table = 'g_editors' verbose_name = "WG Editor" @@ -951,8 +951,8 @@ class WGEditor(models.Model): # This uses the 'g_secretaries' table but is called 'GSecretary' to # match the model naming scheme. class WGSecretary(models.Model): - group_acronym = models.ForeignKey(IETFWG, edit_inline=models.TABULAR) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, unique=True, core=True) + group_acronym = models.ForeignKey(IETFWG) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', unique=True) def __str__(self): return "%s (%s)" % ( self.person, self.role() ) def role(self): @@ -963,8 +963,8 @@ class WGSecretary(models.Model): verbose_name_plural = "WG Secretaries" class WGTechAdvisor(models.Model): - group_acronym = models.ForeignKey(IETFWG, edit_inline=models.TABULAR) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, core=True) + group_acronym = models.ForeignKey(IETFWG) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') def __str__(self): return "%s (%s)" % ( self.person, self.role() ) def role(self): @@ -974,8 +974,8 @@ class WGTechAdvisor(models.Model): verbose_name = "WG Technical Advisor" class AreaGroup(models.Model): - area = models.ForeignKey(Area, db_column='area_acronym_id', related_name='areagroup', core=True) - group = models.ForeignKey(IETFWG, db_column='group_acronym_id', edit_inline=models.TABULAR, num_in_admin=1, max_num_in_admin=1, unique=True) + area = models.ForeignKey(Area, db_column='area_acronym_id', related_name='areagroup') + group = models.ForeignKey(IETFWG, db_column='group_acronym_id', unique=True) def __str__(self): return "%s is in %s" % ( self.group, self.area ) class Meta: @@ -989,11 +989,11 @@ class GoalMilestone(models.Model): ('No', 'Not Done'), ) gm_id = models.AutoField(primary_key=True) - group_acronym = models.ForeignKey(IETFWG, raw_id_admin=True) + group_acronym = models.ForeignKey(IETFWG) description = models.TextField() expected_due_date = models.DateField() done_date = models.DateField(null=True, blank=True) - done = models.CharField(blank=True, choices=DONE_CHOICES, maxlength=4) + done = models.CharField(blank=True, choices=DONE_CHOICES, max_length=4) last_modified_date = models.DateField() def __str__(self): return self.description @@ -1017,8 +1017,8 @@ class Role(models.Model): since expanded to store roles, such as "IAB Exec Dir" and "IAD", so the model is renamed. ''' - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True) - role_name = models.CharField(maxlength=25, db_column='chair_name') + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') + role_name = models.CharField(max_length=25, db_column='chair_name') # Role values IETF_CHAIR = 1 @@ -1044,7 +1044,7 @@ class Role(models.Model): class ChairsHistory(models.Model): chair_type = models.ForeignKey(Role) present_chair = models.BooleanField() - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') start_year = models.IntegerField() end_year = models.IntegerField(null=True, blank=True) def __str__(self): @@ -1059,8 +1059,8 @@ class ChairsHistory(models.Model): # IRTF RG info class IRTF(models.Model): irtf_id = models.AutoField(primary_key=True) - acronym = models.CharField(blank=True, maxlength=25, db_column='irtf_acronym') - name = models.CharField(blank=True, maxlength=255, db_column='irtf_name') + acronym = models.CharField(blank=True, max_length=25, db_column='irtf_acronym') + name = models.CharField(blank=True, max_length=255, db_column='irtf_name') charter_text = models.TextField(blank=True) meeting_scheduled = models.BooleanField(blank=True) def __str__(self): @@ -1072,8 +1072,8 @@ class IRTF(models.Model): pass class IRTFChair(models.Model): - irtf = models.ForeignKey(IRTF, edit_inline=models.STACKED, num_in_admin=2, core=True) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True) + irtf = models.ForeignKey(IRTF) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') def __str__(self): return "%s is chair of %s" % (self.person, self.irtf) class Meta: @@ -1096,3 +1096,10 @@ class DocumentWrapper(object): def __init__(self, document): self.document = document + +# changes done by convert-096.py:changed maxlength to max_length +# removed core +# removed edit_inline +# removed max_num_in_admin +# removed num_in_admin +# removed raw_id_admin diff --git a/ietf/idtracker/views.py b/ietf/idtracker/views.py index 909420f04..df33d2c2f 100644 --- a/ietf/idtracker/views.py +++ b/ietf/idtracker/views.py @@ -2,7 +2,7 @@ # Create your views here. from django.http import HttpResponsePermanentRedirect -from django import newforms as forms +from django import forms from django.template import RequestContext from django.shortcuts import get_object_or_404, render_to_response from django.db.models import Q @@ -210,3 +210,5 @@ def view_comment(*args, **kwargs): def view_ballot(*args, **kwargs): return object_detail(*args, **kwargs) + +# changes done by convert-096.py:changed newforms to forms diff --git a/ietf/iesg/models.py b/ietf/iesg/models.py index 8503cac2a..6749ff79c 100644 --- a/ietf/iesg/models.py +++ b/ietf/iesg/models.py @@ -86,7 +86,7 @@ class TelechatAgendaItem(models.Model): id = models.AutoField(primary_key=True, db_column='template_id') text = models.TextField(blank=True, db_column='template_text') type = models.IntegerField(db_column='template_type', choices=TYPE_CHOICES) - title = models.CharField(maxlength=255, db_column='template_title') + title = models.CharField(max_length=255, db_column='template_title') #The following fields are apparently not used #note = models.TextField(null=True,blank=True) #discussed_status_id = models.IntegerField(null=True, blank=True) @@ -109,7 +109,7 @@ class WGAction(models.Model): note = models.TextField(blank=True,null=True) status_date = models.DateField() agenda = models.BooleanField("On Agenda") - token_name = models.CharField(maxlength=25) + token_name = models.CharField(max_length=25) category = models.IntegerField(db_column='pwg_cat_id', choices=CATEGORY_CHOICES, default=11) telechat_date = models.DateField() #choices = [(x.telechat_date,x.telechat_date) for x in Telechat.objects.all().order_by('-telechat_date')]) def __str__(self): @@ -121,3 +121,5 @@ class WGAction(models.Model): class Admin: pass + +# changes done by convert-096.py:changed maxlength to max_length diff --git a/ietf/ietfauth/auth.py b/ietf/ietfauth/auth.py index 61e08df31..384134501 100644 --- a/ietf/ietfauth/auth.py +++ b/ietf/ietfauth/auth.py @@ -1,7 +1,7 @@ # Copyright The IETF Trust 2007, All Rights Reserved from django.contrib.auth.backends import ModelBackend -from django.core.validators import email_re +from django.forms.fields import email_re from django.contrib.auth.models import User from django.conf import settings from django.core.exceptions import ObjectDoesNotExist @@ -93,3 +93,5 @@ def set_password( user, password, realm=None ): userprof.email_htdigest = htdigest( user.email, password, realm ) userprof.rfced_htdigest = htdigest( user.email, password, 'RFC Editor' ) userprof.save() + +# changes done by convert-096.py:changed email_re import diff --git a/ietf/ietfauth/models.py b/ietf/ietfauth/models.py index f1c46888b..7753852c0 100644 --- a/ietf/ietfauth/models.py +++ b/ietf/ietfauth/models.py @@ -17,12 +17,12 @@ class UserMap(models.Model): user model's password field, the other is here. We also store a hashed version of just the email address for the RFC Editor. """ - user = models.ForeignKey(User, raw_id_admin=True, core=True) + user = models.ForeignKey(User) # user should have unique=True, but that confuses the # admin edit_inline interface. - person = models.ForeignKey(PersonOrOrgInfo, edit_inline=models.STACKED, num_in_admin=1, max_num_in_admin=1, unique=True, null=True) - email_htdigest = models.CharField(maxlength=32, blank=True, null=True) - rfced_htdigest = models.CharField(maxlength=32, blank=True, null=True) + person = models.ForeignKey(PersonOrOrgInfo, unique=True, null=True) + email_htdigest = models.CharField(max_length=32, blank=True, null=True) + rfced_htdigest = models.CharField(max_length=32, blank=True, null=True) def __str__(self): return "Mapping django user %s to IETF person %s" % ( self.user, self.person ) @@ -32,9 +32,9 @@ class UserMap(models.Model): # ietf.idtracker.models.IESGLogin is in the same vein. class LegacyLiaisonUser(models.Model): - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', primary_key=True, raw_id_admin=True) - login_name = models.CharField(maxlength=255) - password = models.CharField(maxlength=25) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', primary_key=True) + login_name = models.CharField(max_length=255) + password = models.CharField(max_length=25) user_level = models.IntegerField(null=True, blank=True) comment = models.TextField(blank=True) def __str__(self): @@ -44,16 +44,23 @@ class LegacyLiaisonUser(models.Model): ordering = ['login_name'] class LegacyWgPassword(models.Model): - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', primary_key=True, raw_id_admin=True) - password = models.CharField(blank=True, maxlength=255) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', primary_key=True) + password = models.CharField(blank=True, max_length=255) secrete_question_id = models.IntegerField(null=True, blank=True) - secrete_answer = models.CharField(blank=True, maxlength=255) + secrete_answer = models.CharField(blank=True, max_length=255) is_tut_resp = models.IntegerField(null=True, blank=True) irtf_id = models.IntegerField(null=True, blank=True) comment = models.TextField(blank=True) - login_name = models.CharField(blank=True, maxlength=100) + login_name = models.CharField(blank=True, max_length=100) def __str__(self): return self.login_name class Meta: db_table = 'wg_password' ordering = ['login_name'] + +# changes done by convert-096.py:changed maxlength to max_length +# removed core +# removed edit_inline +# removed max_num_in_admin +# removed num_in_admin +# removed raw_id_admin diff --git a/ietf/ipr/models.py b/ietf/ipr/models.py index 359579cf1..fe78363c7 100644 --- a/ietf/ipr/models.py +++ b/ietf/ipr/models.py @@ -39,7 +39,7 @@ STATUS_CHOICES = ( class IprSelecttype(models.Model): type_id = models.AutoField(primary_key=True) is_pending = models.IntegerField(unique=True, db_column="selecttype") - type_display = models.CharField(blank=True, maxlength=15) + type_display = models.CharField(blank=True, max_length=15) def __str__(self): return self.type_display class Meta: @@ -49,7 +49,7 @@ class IprSelecttype(models.Model): class IprLicensing(models.Model): licensing_option = models.AutoField(primary_key=True) - value = models.CharField(maxlength=255, db_column='licensing_option_value') + value = models.CharField(max_length=255, db_column='licensing_option_value') def __str__(self): return self.value; class Meta: @@ -60,17 +60,17 @@ class IprLicensing(models.Model): class IprDetail(models.Model): ipr_id = models.AutoField(primary_key=True) - title = models.CharField(blank=True, db_column="document_title", maxlength=255) + title = models.CharField(blank=True, db_column="document_title", max_length=255) # Legacy information fieldset - legacy_url_0 = models.CharField(blank=True, db_column="old_ipr_url", maxlength=255) - legacy_url_1 = models.CharField(blank=True, db_column="additional_old_url1", maxlength=255) - legacy_title_1 = models.CharField(blank=True, db_column="additional_old_title1", maxlength=255) - legacy_url_2 = models.CharField(blank=True, db_column="additional_old_url2", maxlength=255) - legacy_title_2 = models.CharField(blank=True, db_column="additional_old_title2", maxlength=255) + legacy_url_0 = models.CharField(blank=True, db_column="old_ipr_url", max_length=255) + legacy_url_1 = models.CharField(blank=True, db_column="additional_old_url1", max_length=255) + legacy_title_1 = models.CharField(blank=True, db_column="additional_old_title1", max_length=255) + legacy_url_2 = models.CharField(blank=True, db_column="additional_old_url2", max_length=255) + legacy_title_2 = models.CharField(blank=True, db_column="additional_old_title2", max_length=255) # Patent holder fieldset - legal_name = models.CharField("Legal Name", db_column="p_h_legal_name", maxlength=255) + legal_name = models.CharField("Legal Name", db_column="p_h_legal_name", max_length=255) # Patent Holder Contact fieldset # self.contact.filter(contact_type=1) @@ -81,13 +81,13 @@ class IprDetail(models.Model): # Related IETF Documents fieldset rfc_number = models.IntegerField(null=True, editable=False, blank=True) # always NULL id_document_tag = models.IntegerField(null=True, editable=False, blank=True) # always NULL - other_designations = models.CharField(blank=True, maxlength=255) - document_sections = models.TextField("Specific document sections covered", blank=True, maxlength=255, db_column='disclouser_identify') + other_designations = models.CharField(blank=True, max_length=255) + document_sections = models.TextField("Specific document sections covered", blank=True, max_length=255, db_column='disclouser_identify') # Patent Information fieldset - patents = models.TextField("Patent Applications", db_column="p_applications", maxlength=255) - date_applied = models.CharField(maxlength=255) - country = models.CharField(maxlength=100) + patents = models.TextField("Patent Applications", db_column="p_applications", max_length=255) + date_applied = models.CharField(max_length=255) + country = models.CharField(max_length=100) notes = models.TextField("Additional notes", db_column="p_notes", blank=True) is_pending = models.IntegerField("Unpublished Pending Patent Application", blank=True, choices=SELECT_CHOICES, db_column="selecttype") applies_to_all = models.IntegerField("Applies to all IPR owned by Submitter", blank=True, choices=SELECT_CHOICES, db_column="selectowned") @@ -138,16 +138,16 @@ class IprContact(models.Model): ('3', 'Submitter Contact'), ) contact_id = models.AutoField(primary_key=True) - ipr = models.ForeignKey(IprDetail, raw_id_admin=True, edit_inline=True, related_name="contact") + ipr = models.ForeignKey(IprDetail, related_name="contact") contact_type = models.IntegerField(choices=TYPE_CHOICES) - name = models.CharField(maxlength=255, core=True) - title = models.CharField(blank=True, maxlength=255) - department = models.CharField(blank=True, maxlength=255) - address1 = models.CharField(blank=True, maxlength=255) - address2 = models.CharField(blank=True, maxlength=255) - telephone = models.CharField(maxlength=25, core=True) - fax = models.CharField(blank=True, maxlength=25) - email = models.EmailField(maxlength=255, core=True) + name = models.CharField(max_length=255) + title = models.CharField(blank=True, max_length=255) + department = models.CharField(blank=True, max_length=255) + address1 = models.CharField(blank=True, max_length=255) + address2 = models.CharField(blank=True, max_length=255) + telephone = models.CharField(max_length=25) + fax = models.CharField(blank=True, max_length=25) + email = models.EmailField(max_length=255) def __str__(self): return self.name or '' class Meta: @@ -160,9 +160,9 @@ class IprContact(models.Model): class IprDraft(models.Model): - ipr = models.ForeignKey(IprDetail, raw_id_admin=True, edit_inline=True, related_name='drafts') - document = models.ForeignKey(InternetDraft, db_column='id_document_tag', raw_id_admin=True, core=True, related_name="ipr") - revision = models.CharField(maxlength=2) + ipr = models.ForeignKey(IprDetail, related_name='drafts') + document = models.ForeignKey(InternetDraft, db_column='id_document_tag', related_name="ipr") + revision = models.CharField(max_length=2) def __str__(self): return "%s which applies to %s-%s" % ( self.ipr, self.document, self.revision ) class Meta: @@ -171,10 +171,10 @@ class IprDraft(models.Model): pass class IprNotification(models.Model): - ipr = models.ForeignKey(IprDetail, raw_id_admin=True) + ipr = models.ForeignKey(IprDetail) notification = models.TextField(blank=True) date_sent = models.DateField(null=True, blank=True) - time_sent = models.CharField(blank=True, maxlength=25) + time_sent = models.CharField(blank=True, max_length=25) def __str__(self): return "IPR notification for %s sent %s %s" % (self.ipr, self.date_sent, self.time_sent) class Meta: @@ -183,8 +183,8 @@ class IprNotification(models.Model): pass class IprRfc(models.Model): - ipr = models.ForeignKey(IprDetail, edit_inline=True, related_name='rfcs') - document = models.ForeignKey(Rfc, db_column='rfc_number', raw_id_admin=True, core=True, related_name="ipr") + ipr = models.ForeignKey(IprDetail, related_name='rfcs') + document = models.ForeignKey(Rfc, db_column='rfc_number', related_name="ipr") def __str__(self): return "%s applies to RFC%04d" % ( self.ipr, self.document_id ) class Meta: @@ -194,11 +194,16 @@ class IprRfc(models.Model): class IprUpdate(models.Model): id = models.IntegerField(primary_key=True) - ipr = models.ForeignKey(IprDetail, raw_id_admin=True, related_name='updates') - updated = models.ForeignKey(IprDetail, db_column='updated', raw_id_admin=True, related_name='updated_by') + ipr = models.ForeignKey(IprDetail, related_name='updates') + updated = models.ForeignKey(IprDetail, db_column='updated', related_name='updated_by') status_to_be = models.IntegerField(null=True, blank=True) processed = models.IntegerField(null=True, blank=True) class Meta: db_table = 'ipr_updates' class Admin: pass + +# changes done by convert-096.py:changed maxlength to max_length +# removed core +# removed edit_inline +# removed raw_id_admin diff --git a/ietf/ipr/new.py b/ietf/ipr/new.py index fde6fcf25..c05baad85 100644 --- a/ietf/ipr/new.py +++ b/ietf/ipr/new.py @@ -3,7 +3,7 @@ import re import models import ietf.utils -import django.newforms as forms +from django import forms from datetime import datetime from django.shortcuts import render_to_response as render, get_object_or_404 @@ -151,14 +151,14 @@ def new(request, type, update=None, submitter=None): # would like to put this in rfclist to get the error # closer to the fields, but clean_data["draftlist"] # isn't set yet. - rfclist = self.clean_data.get("rfclist", None) - draftlist = self.clean_data.get("draftlist", None) - other = self.clean_data.get("other_designations", None) + rfclist = self.cleaned_data.get("rfclist", None) + draftlist = self.cleaned_data.get("draftlist", None) + other = self.cleaned_data.get("other_designations", None) if not rfclist and not draftlist and not other: raise forms.ValidationError("One of the Document fields below must be filled in") - return self.clean_data + return self.cleaned_data def clean_rfclist(self): - rfclist = self.clean_data.get("rfclist", None) + rfclist = self.cleaned_data.get("rfclist", None) if rfclist: rfclist = re.sub("(?i) *[,;]? *rfc[- ]?", " ", rfclist) rfclist = rfclist.strip().split() @@ -170,7 +170,7 @@ def new(request, type, update=None, submitter=None): rfclist = " ".join(rfclist) return rfclist def clean_draftlist(self): - draftlist = self.clean_data.get("draftlist", None) + draftlist = self.cleaned_data.get("draftlist", None) if draftlist: draftlist = re.sub(" *[,;] *", " ", draftlist) draftlist = draftlist.strip().split() @@ -195,7 +195,7 @@ def new(request, type, update=None, submitter=None): return " ".join(drafts) return "" def clean_licensing_option(self): - licensing_option = self.clean_data['licensing_option'] + licensing_option = self.cleaned_data['licensing_option'] if section_list.get('licensing', False): if licensing_option in (None, ''): raise forms.ValidationError, 'This field is required.' @@ -243,10 +243,10 @@ def new(request, type, update=None, submitter=None): if type == "generic": instance.title = legal_name_genitive + " General License Statement" % legal_name_genitive if type == "specific": - data["ipr_summary"] = get_ipr_summary(form.clean_data) + data["ipr_summary"] = get_ipr_summary(form.cleaned_data) instance.title = legal_name_genitive + """ Statement about IPR related to %(ipr_summary)s""" % data if type == "third-party": - data["ipr_summary"] = get_ipr_summary(form.clean_data) + data["ipr_summary"] = get_ipr_summary(form.cleaned_data) ietf_name_genitive = data['ietf_name'] + "'" if data['ietf_name'].endswith('s') else data['ietf_name'] + "'s" instance.title = ietf_name_genitive + """ Statement about IPR related to %(ipr_summary)s belonging to %(legal_name)s""" % data @@ -292,13 +292,13 @@ def new(request, type, update=None, submitter=None): # log("Invalid contact: %s" % contact) # Save IprDraft(s) - for draft in form.clean_data["draftlist"].split(): + for draft in form.cleaned_data["draftlist"].split(): id = InternetDraft.objects.get(filename=draft[:-3]) iprdraft = models.IprDraft(document=id, ipr=instance, revision=draft[-2:]) iprdraft.save() # Save IprRfc(s) - for rfcnum in form.clean_data["rfclist"].split(): + for rfcnum in form.cleaned_data["rfclist"].split(): rfc = Rfc.objects.get(rfc_number=int(rfcnum)) iprrfc = models.IprRfc(document=rfc, ipr=instance) iprrfc.save() @@ -360,7 +360,7 @@ def update(request, ipr_id=None): log("Form error for field: %s: %s"%(error, form.errors[error])) return render("ipr/update.html", {"form": form, "ipr": ipr, "type": type}, context_instance=RequestContext(request)) else: - submitter = form.clean_data + submitter = form.cleaned_data return new(request, type, ipr, submitter) @@ -381,3 +381,6 @@ def get_ipr_summary(data): ipr = ", ".join(ipr[:-1]) + ", and " + ipr[-1] return ipr + +# changes done by convert-096.py:changed newforms to forms +# cleaned_data diff --git a/ietf/liaisons/models.py b/ietf/liaisons/models.py index 10f89c68f..b58dafc40 100644 --- a/ietf/liaisons/models.py +++ b/ietf/liaisons/models.py @@ -6,7 +6,7 @@ from django.core.exceptions import ObjectDoesNotExist class LiaisonPurpose(models.Model): purpose_id = models.AutoField(primary_key=True) - purpose_text = models.CharField(blank=True, maxlength=50) + purpose_text = models.CharField(blank=True, max_length=50) def __str__(self): return self.purpose_text class Meta: @@ -16,8 +16,8 @@ class LiaisonPurpose(models.Model): class FromBodies(models.Model): from_id = models.AutoField(primary_key=True) - body_name = models.CharField(blank=True, maxlength=35) - poc = models.ForeignKey(PersonOrOrgInfo, db_column='poc', raw_id_admin=True, null=True) + body_name = models.CharField(blank=True, max_length=35) + poc = models.ForeignKey(PersonOrOrgInfo, db_column='poc', null=True) is_liaison_manager = models.BooleanField() other_sdo = models.BooleanField() email_priority = models.IntegerField(null=True, blank=True) @@ -30,28 +30,28 @@ class FromBodies(models.Model): class LiaisonDetail(models.Model): detail_id = models.AutoField(primary_key=True) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') submitted_date = models.DateField(null=True, blank=True) last_modified_date = models.DateField(null=True, blank=True) from_id = models.IntegerField(null=True, blank=True) - to_body = models.CharField(blank=True, maxlength=255) - title = models.CharField(blank=True, maxlength=255) - response_contact = models.CharField(blank=True, maxlength=255) - technical_contact = models.CharField(blank=True, maxlength=255) + to_body = models.CharField(blank=True, max_length=255) + title = models.CharField(blank=True, max_length=255) + response_contact = models.CharField(blank=True, max_length=255) + technical_contact = models.CharField(blank=True, max_length=255) purpose_text = models.TextField(blank=True, db_column='purpose') body = models.TextField(blank=True) deadline_date = models.DateField(null=True, blank=True) cc1 = models.TextField(blank=True) # unclear why cc2 is a CharField, but it's always # either NULL or blank. - cc2 = models.CharField(blank=True, maxlength=50) - submitter_name = models.CharField(blank=True, maxlength=255) - submitter_email = models.CharField(blank=True, maxlength=255) + cc2 = models.CharField(blank=True, max_length=50) + submitter_name = models.CharField(blank=True, max_length=255) + submitter_email = models.CharField(blank=True, max_length=255) by_secretariat = models.IntegerField(null=True, blank=True) - to_poc = models.CharField(blank=True, maxlength=255) - to_email = models.CharField(blank=True, maxlength=255) + to_poc = models.CharField(blank=True, max_length=255) + to_email = models.CharField(blank=True, max_length=255) purpose = models.ForeignKey(LiaisonPurpose) - replyto = models.CharField(blank=True, maxlength=255) + replyto = models.CharField(blank=True, max_length=255) def __str__(self): return self.title or "" def from_body(self): @@ -100,7 +100,7 @@ class LiaisonDetail(models.Model): # probably not currently (Aug 2009) maintained by the secretariat. #class SDOs(models.Model): # sdo_id = models.AutoField(primary_key=True) -# sdo_name = models.CharField(blank=True, maxlength=255) +# sdo_name = models.CharField(blank=True, max_length=255) # def __str__(self): # return self.sdo_name # def liaisonmanager(self): @@ -116,9 +116,9 @@ class LiaisonDetail(models.Model): # This table is not used by any code right now, and according to Glen, # probably not currently (Aug 2009) maintained by the secretariat. #class LiaisonManagers(models.Model): -# person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True) -# email_priority = models.IntegerField(null=True, blank=True, core=True) -# sdo = models.ForeignKey(SDOs, edit_inline=models.TABULAR, num_in_admin=1) +# person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') +# email_priority = models.IntegerField(null=True, blank=True) +# sdo = models.ForeignKey(SDOs) # def email(self): # try: # return self.person.emailaddress_set.get(priority=self.email_priority) @@ -129,9 +129,9 @@ class LiaisonDetail(models.Model): # This table is not used by any code right now. #class LiaisonsInterim(models.Model): -# title = models.CharField(blank=True, maxlength=255) -# submitter_name = models.CharField(blank=True, maxlength=255) -# submitter_email = models.CharField(blank=True, maxlength=255) +# title = models.CharField(blank=True, max_length=255) +# submitter_name = models.CharField(blank=True, max_length=255) +# submitter_email = models.CharField(blank=True, max_length=255) # submitted_date = models.DateField(null=True, blank=True) # from_id = models.IntegerField(null=True, blank=True) # def __str__(self): @@ -143,10 +143,10 @@ class LiaisonDetail(models.Model): class Uploads(models.Model): file_id = models.AutoField(primary_key=True) - file_title = models.CharField(blank=True, maxlength=255, core=True) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True) - file_extension = models.CharField(blank=True, maxlength=10) - detail = models.ForeignKey(LiaisonDetail, raw_id_admin=True, edit_inline=models.TABULAR, num_in_admin=1) + file_title = models.CharField(blank=True, max_length=255) + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') + file_extension = models.CharField(blank=True, max_length=10) + detail = models.ForeignKey(LiaisonDetail) def __str__(self): return self.file_title class Meta: @@ -155,9 +155,15 @@ class Uploads(models.Model): # empty table #class SdoChairs(models.Model): # sdo = models.ForeignKey(SDOs) -# person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True) +# person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') # email_priority = models.IntegerField(null=True, blank=True) # class Meta: # db_table = 'sdo_chairs' # class Admin: # pass + +# changes done by convert-096.py:changed maxlength to max_length +# removed core +# removed edit_inline +# removed num_in_admin +# removed raw_id_admin diff --git a/ietf/mailinglists/models.py b/ietf/mailinglists/models.py index 371a4dcfa..1ec373cc3 100644 --- a/ietf/mailinglists/models.py +++ b/ietf/mailinglists/models.py @@ -5,9 +5,9 @@ from ietf.idtracker.models import Acronym, Area class ImportedMailingList(models.Model): group_acronym = models.ForeignKey(Acronym, null=True) - acronym = models.CharField(maxlength=255, db_column='list_acronym') - name = models.CharField(blank=True, maxlength=255, db_column='list_name') - domain = models.CharField(blank=True, maxlength=25, db_column='list_domain') + acronym = models.CharField(max_length=255, db_column='list_acronym') + name = models.CharField(blank=True, max_length=255, db_column='list_name') + domain = models.CharField(blank=True, max_length=25, db_column='list_domain') def __str__(self): return self.acronym or self.group_acronym.acronym def choices(dname): @@ -23,21 +23,21 @@ class ImportedMailingList(models.Model): pass class NonWgMailingList(models.Model): - id = models.CharField(primary_key=True, maxlength=35) - s_name = models.CharField("Submitter's Name", blank=True, maxlength=255) - s_email = models.EmailField("Submitter's Email Address", blank=True, maxlength=255) - list_name = models.CharField("Mailing List Name", unique=True, maxlength=255) - list_url = models.CharField("List URL", maxlength=255) + id = models.CharField(primary_key=True, max_length=35) + s_name = models.CharField("Submitter's Name", blank=True, max_length=255) + s_email = models.EmailField("Submitter's Email Address", blank=True, max_length=255) + list_name = models.CharField("Mailing List Name", unique=True, max_length=255) + list_url = models.CharField("List URL", max_length=255) admin = models.TextField("Administrator(s)' Email Address(es)", blank=True) purpose = models.TextField(blank=True) area = models.ForeignKey(Area, db_column='area_acronym_id', null=True) - subscribe_url = models.CharField("Subscribe URL", blank=True, maxlength=255) + subscribe_url = models.CharField("Subscribe URL", blank=True, max_length=255) subscribe_other = models.TextField("Subscribe Other", blank=True) # Can be 0, 1, -1, or what looks like a person_or_org_tag, positive or neg. # The values less than 1 don't get displayed on the list of lists. status = models.IntegerField() - ds_name = models.CharField(blank=True, maxlength=255) - ds_email = models.EmailField(blank=True, maxlength=255) + ds_name = models.CharField(blank=True, max_length=255) + ds_email = models.EmailField(blank=True, max_length=255) msg_to_ad = models.TextField(blank=True) def __str__(self): return self.list_name @@ -50,3 +50,5 @@ class NonWgMailingList(models.Model): class Admin: pass + +# changes done by convert-096.py:changed maxlength to max_length diff --git a/ietf/proceedings/models.py b/ietf/proceedings/models.py index 1e80dee2f..1f4097ba3 100644 --- a/ietf/proceedings/models.py +++ b/ietf/proceedings/models.py @@ -130,9 +130,9 @@ class Meeting(models.Model): meeting_num = models.IntegerField(primary_key=True) start_date = models.DateField() end_date = models.DateField() - city = models.CharField(blank=True, maxlength=255) - state = models.CharField(blank=True, maxlength=255) - country = models.CharField(blank=True, maxlength=255) + city = models.CharField(blank=True, max_length=255) + state = models.CharField(blank=True, max_length=255) + country = models.CharField(blank=True, max_length=255) time_zone = models.IntegerField(null=True, blank=True, choices=TIME_ZONE_CHOICES) ack = models.TextField(blank=True) agenda_html = models.TextField(blank=True) @@ -154,8 +154,8 @@ class Meeting(models.Model): class MeetingVenue(models.Model): meeting_num = models.ForeignKey(Meeting, db_column='meeting_num', unique=True) - break_area_name = models.CharField(maxlength=255) - reg_area_name = models.CharField(maxlength=255) + break_area_name = models.CharField(max_length=255) + reg_area_name = models.CharField(max_length=255) def __str__(self): return "IETF %s" % (self.meeting_num_id) class Meta: @@ -164,7 +164,7 @@ class MeetingVenue(models.Model): pass class NonSessionRef(models.Model): - name = models.CharField(maxlength=255) + name = models.CharField(max_length=255) def __str__(self): return self.name class Meta: @@ -177,7 +177,7 @@ class NonSession(models.Model): day_id = models.IntegerField(blank=True, null=True) non_session_ref = models.ForeignKey(NonSessionRef) meeting = models.ForeignKey(Meeting, db_column='meeting_num') - time_desc = models.CharField(blank=True, maxlength=75) + time_desc = models.CharField(blank=True, max_length=75) show_break_location = models.BooleanField() def __str__(self): if self.day_id: @@ -191,7 +191,7 @@ class NonSession(models.Model): class Proceeding(models.Model): meeting_num = models.ForeignKey(Meeting, db_column='meeting_num', unique=True, primary_key=True) - dir_name = models.CharField(blank=True, maxlength=25) + dir_name = models.CharField(blank=True, max_length=25) sub_begin_date = models.DateField(null=True, blank=True) sub_cut_off_date = models.DateField(null=True, blank=True) frozen = models.IntegerField(null=True, blank=True) @@ -207,8 +207,8 @@ class Proceeding(models.Model): # pass # admin site doesn't like something about meeting_num class SessionConflict(models.Model): - group_acronym = models.ForeignKey(Acronym, raw_id_admin=True, related_name='conflicts_set') - conflict_gid = models.ForeignKey(Acronym, raw_id_admin=True, related_name='conflicts_with_set', db_column='conflict_gid') + group_acronym = models.ForeignKey(Acronym, related_name='conflicts_set') + conflict_gid = models.ForeignKey(Acronym, related_name='conflicts_with_set', db_column='conflict_gid') meeting_num = models.ForeignKey(Meeting, db_column='meeting_num') def __str__(self): return "At IETF %s, %s conflicts with %s" % ( self.meeting_num_id, self.group_acronym.acronym, self.conflict_gid.acronym) @@ -219,7 +219,7 @@ class SessionConflict(models.Model): class SessionName(models.Model): session_name_id = models.AutoField(primary_key=True) - session_name = models.CharField(blank=True, maxlength=255) + session_name = models.CharField(blank=True, max_length=255) def __str__(self): return self.session_name class Meta: @@ -227,9 +227,9 @@ class SessionName(models.Model): class Admin: pass class IESGHistory(models.Model): - meeting = models.ForeignKey(Meeting, db_column='meeting_num', core=True) - area = models.ForeignKey(Area, db_column='area_acronym_id', core=True) - person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True, core=True) + meeting = models.ForeignKey(Meeting, db_column='meeting_num') + area = models.ForeignKey(Area, db_column='area_acronym_id') + person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag') def __str__(self): return "%s (%s)" % (self.person,self.area) class Meta: @@ -239,7 +239,7 @@ class IESGHistory(models.Model): class MeetingTime(models.Model): time_id = models.AutoField(primary_key=True) - time_desc = models.CharField(maxlength=100) + time_desc = models.CharField(max_length=100) meeting = models.ForeignKey(Meeting, db_column='meeting_num', unique=True) day_id = models.IntegerField() session_name = models.ForeignKey(SessionName,null=True) @@ -303,7 +303,7 @@ class MeetingTime(models.Model): class MeetingRoom(models.Model): room_id = models.AutoField(primary_key=True) meeting = models.ForeignKey(Meeting, db_column='meeting_num') - room_name = models.CharField(maxlength=255) + room_name = models.CharField(max_length=255) def __str__(self): return "[%d] %s" % (self.meeting_id, self.room_name) class Meta: @@ -317,12 +317,12 @@ class WgMeetingSession(models.Model, ResolveAcronym): group_acronym_id = models.IntegerField() irtf = models.NullBooleanField() num_session = models.IntegerField() - length_session1 = models.CharField(blank=True, maxlength=100) - length_session2 = models.CharField(blank=True, maxlength=100) - length_session3 = models.CharField(blank=True, maxlength=100) - conflict1 = models.CharField(blank=True, maxlength=255) - conflict2 = models.CharField(blank=True, maxlength=255) - conflict3 = models.CharField(blank=True, maxlength=255) + length_session1 = models.CharField(blank=True, max_length=100) + length_session2 = models.CharField(blank=True, max_length=100) + length_session3 = models.CharField(blank=True, max_length=100) + conflict1 = models.CharField(blank=True, max_length=255) + conflict2 = models.CharField(blank=True, max_length=255) + conflict3 = models.CharField(blank=True, max_length=255) conflict_other = models.TextField(blank=True) special_req = models.TextField(blank=True) number_attendee = models.IntegerField(null=True, blank=True) @@ -331,7 +331,7 @@ class WgMeetingSession(models.Model, ResolveAcronym): ts_status_id = models.IntegerField(null=True, blank=True) requested_date = models.DateField(null=True, blank=True) approved_date = models.DateField(null=True, blank=True) - requested_by = models.ForeignKey(PersonOrOrgInfo, raw_id_admin=True, db_column='requested_by') + requested_by = models.ForeignKey(PersonOrOrgInfo, db_column='requested_by') scheduled_date = models.DateField(null=True, blank=True) last_modified_date = models.DateField(null=True, blank=True) ad_comments = models.TextField(blank=True) @@ -344,7 +344,7 @@ class WgMeetingSession(models.Model, ResolveAcronym): sched_room_id3 = models.ForeignKey(MeetingRoom, db_column='sched_room_id3', null=True, blank=True, related_name='here3') sched_time_id3 = models.ForeignKey(MeetingTime, db_column='sched_time_id3', null=True, blank=True, related_name='now3') sched_date3 = models.DateField(null=True, blank=True) - special_agenda_note = models.CharField(blank=True, maxlength=255) + special_agenda_note = models.CharField(blank=True, max_length=255) combined_room_id1 = models.ForeignKey(MeetingRoom, db_column='combined_room_id1', null=True, blank=True, related_name='here4') combined_time_id1 = models.ForeignKey(MeetingTime, db_column='combined_time_id1', null=True, blank=True, related_name='now4') combined_room_id2 = models.ForeignKey(MeetingRoom, db_column='combined_room_id2', null=True, blank=True, related_name='here5') @@ -425,7 +425,7 @@ class WgMeetingSession(models.Model, ResolveAcronym): class WgAgenda(models.Model, ResolveAcronym): meeting = models.ForeignKey(Meeting, db_column='meeting_num') group_acronym_id = models.IntegerField() - filename = models.CharField(maxlength=255) + filename = models.CharField(max_length=255) irtf = models.IntegerField() interim = models.BooleanField() def __str__(self): @@ -438,7 +438,7 @@ class WgAgenda(models.Model, ResolveAcronym): class Minute(models.Model, ResolveAcronym): meeting = models.ForeignKey(Meeting, db_column='meeting_num') group_acronym_id = models.IntegerField() - filename = models.CharField(blank=True, maxlength=255) + filename = models.CharField(blank=True, max_length=255) irtf = models.IntegerField() interim = models.BooleanField() def __str__(self): @@ -452,7 +452,7 @@ class Minute(models.Model, ResolveAcronym): # is only used for the agenda generation right now so we'll # put it here. class Switches(models.Model): - name = models.CharField(maxlength=100) + name = models.CharField(max_length=100) val = models.IntegerField(null=True, blank=True) updated_date = models.DateField(null=True, blank=True) updated_time = models.TimeField(null=True, blank=True) @@ -468,7 +468,7 @@ class Switches(models.Model): # Empty table, don't pretend that it exists. #class SlideTypes(models.Model): # type_id = models.AutoField(primary_key=True) -# type = models.CharField(maxlength=255, db_column='type_name') +# type = models.CharField(max_length=255, db_column='type_name') # def __str__(self): # return self.type # class Meta: @@ -488,7 +488,7 @@ class Slide(models.Model, ResolveAcronym): group_acronym_id = models.IntegerField(null=True, blank=True) slide_num = models.IntegerField(null=True, blank=True) slide_type_id = models.IntegerField(choices=SLIDE_TYPE_CHOICES) - slide_name = models.CharField(blank=True, maxlength=255) + slide_name = models.CharField(blank=True, max_length=255) irtf = models.IntegerField() interim = models.BooleanField() order_num = models.IntegerField(null=True, blank=True) @@ -520,12 +520,12 @@ class Slide(models.Model, ResolveAcronym): class WgProceedingsActivities(models.Model, ResolveAcronym): id = models.AutoField(primary_key=True) #group_acronym_id = models.IntegerField(null=True, blank=True) - group_acronym = models.ForeignKey(Acronym, raw_id_admin=True) + group_acronym = models.ForeignKey(Acronym) meeting = models.ForeignKey(Meeting, db_column='meeting_num') - activity = models.CharField(blank=True, maxlength=255) + activity = models.CharField(blank=True, max_length=255) act_date = models.DateField(null=True, blank=True) - act_time = models.CharField(blank=True, maxlength=100) + act_time = models.CharField(blank=True, max_length=100) act_by = models.ForeignKey(PersonOrOrgInfo, db_column='act_by') irtf = None @@ -536,3 +536,7 @@ class WgProceedingsActivities(models.Model, ResolveAcronym): db_table = 'wg_proceedings_activities' class Admin: pass + +# changes done by convert-096.py:changed maxlength to max_length +# removed core +# removed raw_id_admin diff --git a/ietf/redirects/models.py b/ietf/redirects/models.py index 854742d0a..855f07499 100644 --- a/ietf/redirects/models.py +++ b/ietf/redirects/models.py @@ -15,10 +15,10 @@ class Redirect(models.Model): searched for in the Command table to see if there is a different value of rest= and remove=. """ - cgi = models.CharField(maxlength=50, unique=True, blank=True) - url = models.CharField(maxlength=255) - rest = models.CharField(maxlength=100, blank=True) - remove = models.CharField(maxlength=50, blank=True) + cgi = models.CharField(max_length=50, unique=True, blank=True) + url = models.CharField(max_length=255) + rest = models.CharField(max_length=100, blank=True) + remove = models.CharField(max_length=50, blank=True) def __str__(self): return "%s -> %s/%s" % (self.cgi, self.url, self.rest) class Admin: @@ -28,8 +28,8 @@ class Suffix(models.Model): """This is a "rest" and "remove" (see Redirect class) for requests with command=. """ - rest = models.CharField(maxlength=100, blank=True) - remove = models.CharField(maxlength=50, blank=True) + rest = models.CharField(max_length=100, blank=True) + remove = models.CharField(max_length=50, blank=True) def __str__(self): return "-> %s - %s" % (self.rest, self.remove) class Meta: @@ -44,9 +44,9 @@ class Command(models.Model): use than those specified in the Redirect class that matched. The optional "url" is prepended to the "rest". """ - command = models.CharField(maxlength=50, core=True) - url = models.CharField(maxlength=50, blank=True) - script = models.ForeignKey(Redirect, edit_inline=models.TABULAR, related_name='commands', editable=False) + command = models.CharField(max_length=50) + url = models.CharField(max_length=50, blank=True) + script = models.ForeignKey(Redirect, related_name='commands', editable=False) suffix = models.ForeignKey(Suffix, null=True, blank=True) def __str__(self): ret = "%s?command=%s" % (self.script.cgi, self.command) @@ -57,3 +57,7 @@ class Command(models.Model): unique_together = (("script", "command"), ) class Admin: pass + +# changes done by convert-096.py:changed maxlength to max_length +# removed core +# removed edit_inline