From d54df175a89385e50193447d02e6842e28c24f7d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Nov 2013 20:55:05 -0600 Subject: Django 1.6 upgrade, deprecation cleanup PendingDeprecationWarning: `queryset` method should be renamed `get_queryset` Signed-off-by: Dan McGee --- packages/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/admin.py b/packages/admin.py index 820bbb2..4680c75 100644 --- a/packages/admin.py +++ b/packages/admin.py @@ -20,7 +20,7 @@ class FlagRequestAdmin(admin.ModelAdmin): ordering = ('-created',) date_hierarchy = 'created' - def queryset(self, request): + def get_queryset(self, request): qs = super(FlagRequestAdmin, self).queryset(request) return qs.select_related('repo', 'user') @@ -42,7 +42,7 @@ class SignoffSpecificationAdmin(admin.ModelAdmin): ordering = ('-created',) date_hierarchy = 'created' - def queryset(self, request): + def get_queryset(self, request): qs = super(SignoffSpecificationAdmin, self).queryset(request) return qs.select_related('arch', 'repo', 'user') -- cgit v1.2.3-24-g4f1b From 3061d1c9515cd44ecc79f95c57b268564a481ccf Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Nov 2013 20:56:15 -0600 Subject: Django 1.6 upgrade, deprecation cleanup PendingDeprecationWarning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form needs updating Signed-off-by: Dan McGee --- mirrors/admin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mirrors/admin.py b/mirrors/admin.py index d0f2f47..e35d9ce 100644 --- a/mirrors/admin.py +++ b/mirrors/admin.py @@ -10,6 +10,7 @@ from .models import (Mirror, MirrorProtocol, MirrorUrl, MirrorRsync, class MirrorUrlForm(forms.ModelForm): class Meta: model = MirrorUrl + fields = ('url', 'country', 'active') def clean_url(self): # is this a valid-looking URL? @@ -39,6 +40,7 @@ class MirrorUrlInlineAdmin(admin.TabularInline): class MirrorRsyncForm(forms.ModelForm): class Meta: model = MirrorRsync + fields = ('ip',) class MirrorRsyncInlineAdmin(admin.TabularInline): @@ -50,6 +52,10 @@ class MirrorRsyncInlineAdmin(admin.TabularInline): class MirrorAdminForm(forms.ModelForm): class Meta: model = Mirror + fields = ('name', 'tier', 'upstream', 'admin_email', 'alternate_email', + 'public', 'active', 'isos', 'rsync_user', 'rsync_password', + 'notes') + upstream = forms.ModelChoiceField( queryset=Mirror.objects.filter(tier__gte=0, tier__lte=1), required=False) -- cgit v1.2.3-24-g4f1b From 86f9d6788e22376560ca1a56e86c8f679b832907 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Nov 2013 21:10:52 -0600 Subject: Django 1.6 upgrade, deprecation cleanup PendingDeprecationWarning: 'The `cycle` template tag is changing to escape its arguments; the non-autoescaping version is deprecated. Load it from the `future` tag library to start using the new behavior. Signed-off-by: Dan McGee --- templates/devel/clock.html | 1 + templates/devel/index.html | 1 + templates/devel/packages.html | 1 + templates/devel/stats.html | 1 + templates/mirrors/error_table.html | 1 + templates/mirrors/mirror_details.html | 1 + templates/mirrors/mirrors.html | 1 + templates/mirrors/status_table.html | 1 + templates/news/list.html | 2 ++ templates/packages/differences.html | 1 + templates/packages/groups.html | 1 + templates/packages/packages_list.html | 1 + templates/packages/search.html | 1 + templates/packages/signoffs.html | 1 + templates/packages/stale_relations.html | 1 + templates/releng/release_list.html | 1 + templates/todolists/list.html | 1 + templates/todolists/view.html | 1 + 18 files changed, 19 insertions(+) diff --git a/templates/devel/clock.html b/templates/devel/clock.html index 2c5bfac..9d672f1 100644 --- a/templates/devel/clock.html +++ b/templates/devel/clock.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% load flags %} {% load tz %} diff --git a/templates/devel/index.html b/templates/devel/index.html index 03e5d73..c0c437a 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% load cache %} {% load package_extras %} diff --git a/templates/devel/packages.html b/templates/devel/packages.html index d6aab49..74aebf2 100644 --- a/templates/devel/packages.html +++ b/templates/devel/packages.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% load attributes %} {% load package_extras %} diff --git a/templates/devel/stats.html b/templates/devel/stats.html index 2dbe475..9b3b1d2 100644 --- a/templates/devel/stats.html +++ b/templates/devel/stats.html @@ -1,3 +1,4 @@ +{% load cycle from future %} {% load cache %} {% cache 60 dev-dash-by-arch %} diff --git a/templates/mirrors/error_table.html b/templates/mirrors/error_table.html index 6054814..cd7265a 100644 --- a/templates/mirrors/error_table.html +++ b/templates/mirrors/error_table.html @@ -1,3 +1,4 @@ +{% load cycle from future %} {% load flags mirror_status %} diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html index 1c7f563..f2ffce2 100644 --- a/templates/mirrors/mirror_details.html +++ b/templates/mirrors/mirror_details.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% load mirror_status %} {% load flags %} diff --git a/templates/mirrors/mirrors.html b/templates/mirrors/mirrors.html index 458b693..4276b30 100644 --- a/templates/mirrors/mirrors.html +++ b/templates/mirrors/mirrors.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% block title %}Arch Linux - Mirror Overview{% endblock %} diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html index 2817542..6fc07a3 100644 --- a/templates/mirrors/status_table.html +++ b/templates/mirrors/status_table.html @@ -1,3 +1,4 @@ +{% load cycle from future %} {% load flags mirror_status %}
diff --git a/templates/news/list.html b/templates/news/list.html index e85cece..4acbc7e 100644 --- a/templates/news/list.html +++ b/templates/news/list.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% load cycle from future %} + {% block title %}Arch Linux - News{% endblock %} {% block head %} diff --git a/templates/packages/differences.html b/templates/packages/differences.html index b0b9b41..f137126 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% block title %}Arch Linux - Package Differences Reports{% endblock %} diff --git a/templates/packages/groups.html b/templates/packages/groups.html index c135791..ee4f031 100644 --- a/templates/packages/groups.html +++ b/templates/packages/groups.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% block title %}Arch Linux - Package Groups{% if arch %} - {{ arch }}{% endif %}{% endblock %} diff --git a/templates/packages/packages_list.html b/templates/packages/packages_list.html index 3dcc03d..0a1627f 100644 --- a/templates/packages/packages_list.html +++ b/templates/packages/packages_list.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% load package_extras %} diff --git a/templates/packages/search.html b/templates/packages/search.html index f50bc8b..d312c37 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load package_extras %} {% block title %}Arch Linux - Package Database{% endblock %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 807b613..83f81d3 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% load package_extras %} diff --git a/templates/packages/stale_relations.html b/templates/packages/stale_relations.html index 14fac39..76f3205 100644 --- a/templates/packages/stale_relations.html +++ b/templates/packages/stale_relations.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% block title %}Arch Linux - Stale Package Relations{% endblock %} diff --git a/templates/releng/release_list.html b/templates/releng/release_list.html index 7197cc8..f7e9037 100644 --- a/templates/releng/release_list.html +++ b/templates/releng/release_list.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% block title %}Arch Linux - Releases{% endblock %} diff --git a/templates/todolists/list.html b/templates/todolists/list.html index 56f9874..7f0368d 100644 --- a/templates/todolists/list.html +++ b/templates/todolists/list.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% block title %}Arch Linux - Todo Lists{% endblock %} diff --git a/templates/todolists/view.html b/templates/todolists/view.html index b26cd91..a3ee547 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load cycle from future %} {% load static from staticfiles %} {% load package_extras %} {% load todolists %} -- cgit v1.2.3-24-g4f1b From ee6002c911952ddc8cfd07fded3de2c9b0193dc6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Nov 2013 21:17:27 -0600 Subject: Django 1.6 upgrade, deprecation cleanup PendingDeprecationWarning: commit_on_success is deprecated in favor of atomic. Signed-off-by: Dan McGee --- devel/management/commands/pgp_import.py | 4 ++-- devel/management/commands/rematch_developers.py | 4 ++-- devel/management/commands/reporead.py | 10 +++++----- devel/management/commands/reporead_inotify.py | 2 +- devel/views.py | 4 ++-- mirrors/management/commands/mirrorcheck.py | 2 +- packages/views/flag.py | 2 +- packages/views/signoff.py | 2 +- todolists/views.py | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/devel/management/commands/pgp_import.py b/devel/management/commands/pgp_import.py index faa9ff5..3f557fe 100644 --- a/devel/management/commands/pgp_import.py +++ b/devel/management/commands/pgp_import.py @@ -134,7 +134,7 @@ def import_keys(keyring): logger.info("creating or finding %d keys", len(keydata)) created_ct = updated_ct = 0 - with transaction.commit_on_success(): + with transaction.atomic(): finder = UserFinder() # we are dependent on parents coming before children; parse_keydata # uses an OrderedDict to ensure this is the case. @@ -232,7 +232,7 @@ def import_signatures(keyring): logger.info("creating or finding up to %d signatures", len(pruned_edges)) created_ct = updated_ct = 0 - with transaction.commit_on_success(): + with transaction.atomic(): for edge in pruned_edges: sig, created = PGPSignature.objects.get_or_create( signer=edge.signer, signee=edge.signee, diff --git a/devel/management/commands/rematch_developers.py b/devel/management/commands/rematch_developers.py index 2b37958..7a06e08 100644 --- a/devel/management/commands/rematch_developers.py +++ b/devel/management/commands/rematch_developers.py @@ -44,7 +44,7 @@ class Command(NoArgsCommand): match_packager(finder) match_flagrequest(finder) -@transaction.commit_on_success +@transaction.atomic def match_packager(finder): logger.info("getting all unmatched packager strings") package_count = matched_count = 0 @@ -70,7 +70,7 @@ def match_packager(finder): package_count, matched_count) -@transaction.commit_on_success +@transaction.atomic def match_flagrequest(finder): logger.info("getting all flag request email addresses from unknown users") req_count = matched_count = 0 diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index ff7a842..19d54e1 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -302,7 +302,7 @@ def update_common(archname, reponame, pkgs, sanity_check=True): # If isolation level is repeatable-read, we need to ensure each package # update starts a new transaction and re-queries the database as # necessary to guard against simultaneous updates. - with transaction.commit_on_success(): + with transaction.atomic(): # force the transaction dirty, even though we will only do reads transaction.set_dirty() @@ -365,7 +365,7 @@ def db_update(archname, reponame, pkgs, force=False): dbpkg = Package(pkgname=pkg.name, arch=architecture, repo=repository, created=timestamp) try: - with transaction.commit_on_success(): + with transaction.atomic(): populate_pkg(dbpkg, pkg, timestamp=timestamp) Update.objects.log_update(None, dbpkg) except IntegrityError: @@ -380,7 +380,7 @@ def db_update(archname, reponame, pkgs, force=False): for pkgname in (dbset - syncset): logger.info("Removing package %s", pkgname) dbpkg = dbdict[pkgname] - with transaction.commit_on_success(): + with transaction.atomic(): Update.objects.log_update(dbpkg, None) # no race condition here as long as simultaneous threads both # issue deletes; second delete will be a no-op @@ -403,7 +403,7 @@ def db_update(archname, reponame, pkgs, force=False): # The odd select_for_update song and dance here are to ensure # simultaneous updates don't happen on a package, causing # files/depends/all related items to be double-imported. - with transaction.commit_on_success(): + with transaction.atomic(): dbpkg = Package.objects.select_for_update().get(id=dbpkg.id) if not force and pkg_same_version(pkg, dbpkg): logger.debug("Package %s was already updated", pkg.name) @@ -431,7 +431,7 @@ def filesonly_update(archname, reponame, pkgs, force=False): # The odd select_for_update song and dance here are to ensure # simultaneous updates don't happen on a package, causing # files to be double-imported. - with transaction.commit_on_success(): + with transaction.atomic(): if not dbpkg.files_last_update or not dbpkg.last_update: pass elif not force and dbpkg.files_last_update >= dbpkg.last_update: diff --git a/devel/management/commands/reporead_inotify.py b/devel/management/commands/reporead_inotify.py index 6aa4e0e..e3c720b 100644 --- a/devel/management/commands/reporead_inotify.py +++ b/devel/management/commands/reporead_inotify.py @@ -66,7 +66,7 @@ class Command(BaseCommand): if hasattr(thread, 'cancel'): thread.cancel() - @transaction.commit_on_success + @transaction.atomic def setup_notifier(self): '''Set up and configure the inotify machinery and logic. This takes the provided or default path_template and builds a list of diff --git a/devel/views.py b/devel/views.py index 378d6d5..fe7fdf8 100644 --- a/devel/views.py +++ b/devel/views.py @@ -166,7 +166,7 @@ def change_profile(request): request.user.email = form.cleaned_data['email'] if form.cleaned_data['passwd1']: request.user.set_password(form.cleaned_data['passwd1']) - with transaction.commit_on_success(): + with transaction.atomic(): request.user.save() profile_form.save() return HttpResponseRedirect('/devel/') @@ -334,7 +334,7 @@ def new_user_form(request): if request.POST: form = NewUserForm(request.POST) if form.is_valid(): - with transaction.commit_on_success(): + with transaction.atomic(): form.save() log_addition(request, form.instance.user) return HttpResponseRedirect('/admin/auth/user/%d/' % \ diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index 3f026c3..e48aa42 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -241,7 +241,7 @@ class MirrorCheckPool(object): thread.daemon = True self.threads.append(thread) - @transaction.commit_on_success + @transaction.atomic def run(self): logger.debug("starting threads") for thread in self.threads: diff --git a/packages/views/flag.py b/packages/views/flag.py index 39cdcef..9fe60e2 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -84,7 +84,7 @@ def flag(request, name, repo, arch): else: email = form.cleaned_data['email'] - @transaction.commit_on_success + @transaction.atomic def perform_updates(): current_time = now() pkgs.update(flag_date=current_time) diff --git a/packages/views/signoff.py b/packages/views/signoff.py index c37aa0f..fcc6de4 100644 --- a/packages/views/signoff.py +++ b/packages/views/signoff.py @@ -81,7 +81,7 @@ class SignoffOptionsForm(forms.ModelForm): def _signoff_options_all(request, name, repo): seen_ids = set() - with transaction.commit_on_success(): + with transaction.atomic(): # find or create a specification for all architectures, then # graft the form data onto them packages = Package.objects.filter(pkgbase=name, diff --git a/todolists/views.py b/todolists/views.py index ff75686..c37c13f 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -147,7 +147,7 @@ class DeleteTodolist(DeleteView): success_url = '/todo/' -@transaction.commit_on_success +@transaction.atomic def create_todolist_packages(form, creator=None): package_names = form.package_names() packages = form.packages() -- cgit v1.2.3-24-g4f1b From b45700ffe841004af5943c683e0bb0c8f0877015 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Nov 2013 21:35:32 -0600 Subject: Bump requirements versions for Django 1.6 Signed-off-by: Dan McGee --- requirements.txt | 4 ++-- requirements_prod.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 479c213..08d8910 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -e git+git://github.com/fredj/cssmin.git@master#egg=cssmin -Django==1.5.5 +Django==1.6 IPy==0.81 Markdown==2.3.1 South==0.8.2 @@ -7,4 +7,4 @@ bencode==1.0 django-countries==1.5 jsmin==2.0.6 pgpdump==1.4 -pytz>=2013.7 +pytz>=2013.8 diff --git a/requirements_prod.txt b/requirements_prod.txt index 2c38903..565c3c6 100644 --- a/requirements_prod.txt +++ b/requirements_prod.txt @@ -1,5 +1,5 @@ -e git+git://github.com/fredj/cssmin.git@master#egg=cssmin -Django==1.5.5 +Django==1.6 IPy==0.81 Markdown==2.3.1 South==0.8.2 @@ -10,4 +10,4 @@ pgpdump==1.4 psycopg2==2.5.1 pyinotify==0.9.4 python-memcached==1.53 -pytz>=2013.7 +pytz>=2013.8 -- cgit v1.2.3-24-g4f1b From cf27baf51956747f9ea5a349d41e796031871c5c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Nov 2013 21:48:52 -0600 Subject: Add new `signature_bytes` field on package model Now that we have a BinaryField option in Django 1.6, put it to use. Signed-off-by: Dan McGee --- ...0065_auto__add_field_package_signature_bytes.py | 115 +++++++++++++++++++++ main/models.py | 7 +- 2 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 main/migrations/0065_auto__add_field_package_signature_bytes.py diff --git a/main/migrations/0065_auto__add_field_package_signature_bytes.py b/main/migrations/0065_auto__add_field_package_signature_bytes.py new file mode 100644 index 0000000..95c596c --- /dev/null +++ b/main/migrations/0065_auto__add_field_package_signature_bytes.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + db.add_column('packages', 'signature_bytes', + self.gf('django.db.models.fields.BinaryField')(null=True), + keep_default=True) + + def backwards(self, orm): + db.delete_column('packages', 'signature_bytes') + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + u'main.arch': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Arch', 'db_table': "'arches'"}, + 'agnostic': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'required_signoffs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '2'}) + }, + u'main.donor': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Donor', 'db_table': "'donors'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) + }, + u'main.package': { + 'Meta': {'ordering': "('pkgname',)", 'unique_together': "(('pkgname', 'repo', 'arch'),)", 'object_name': 'Package', 'db_table': "'packages'"}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'on_delete': 'models.PROTECT', 'to': u"orm['main.Arch']"}), + 'build_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'compressed_size': ('main.fields.PositiveBigIntegerField', [], {}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'files_last_update': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'flag_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'installed_size': ('main.fields.PositiveBigIntegerField', [], {}), + 'last_update': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'packager': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}), + 'packager_str': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pgp_signature': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgdesc': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'pkgname': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'on_delete': 'models.PROTECT', 'to': u"orm['main.Repo']"}), + 'signature_bytes': ('django.db.models.fields.BinaryField', [], {'null': 'True'}), + 'url': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) + }, + u'main.packagefile': { + 'Meta': {'object_name': 'PackageFile', 'db_table': "'package_files'"}, + 'directory': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_directory': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['main.Package']"}) + }, + u'main.repo': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Repo', 'db_table': "'repos'"}, + 'bugs_category': ('django.db.models.fields.SmallIntegerField', [], {'default': '2'}), + 'bugs_project': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'staging': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'svn_root': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + } + } + + complete_apps = ['main'] diff --git a/main/models.py b/main/models.py index 2ace010..91f1483 100644 --- a/main/models.py +++ b/main/models.py @@ -97,7 +97,7 @@ class Package(models.Model): pkgver = models.CharField(max_length=255) pkgrel = models.CharField(max_length=255) epoch = models.PositiveIntegerField(default=0) - pkgdesc = models.TextField(null=True) + pkgdesc = models.TextField('description', null=True) url = models.CharField(max_length=255, null=True) filename = models.CharField(max_length=255) compressed_size = PositiveBigIntegerField() @@ -106,10 +106,11 @@ class Package(models.Model): last_update = models.DateTimeField(db_index=True) files_last_update = models.DateTimeField(null=True, blank=True) created = models.DateTimeField() - packager_str = models.CharField(max_length=255) + packager_str = models.CharField('packager string', max_length=255) packager = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL) - pgp_signature = models.TextField(null=True, blank=True) + pgp_signature = models.TextField('PGP signature', null=True, blank=True) + signature_bytes = models.BinaryField('PGP signature', null=True) flag_date = models.DateTimeField(null=True, blank=True) objects = PackageManager() -- cgit v1.2.3-24-g4f1b From a4cf77ba247605fb442b314e311de2829bb3706b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Nov 2013 22:05:18 -0600 Subject: Move signature data from base64 string to bytes type Signed-off-by: Dan McGee --- devel/management/commands/reporead.py | 3 +- main/migrations/0066_move_signature_data.py | 125 ++++++++++++++++++++++++++++ main/models.py | 9 +- 3 files changed, 129 insertions(+), 8 deletions(-) create mode 100644 main/migrations/0066_move_signature_data.py diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 19d54e1..2b565cf 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -13,6 +13,7 @@ Example: ./manage.py reporead i686 /tmp/core.db.tar.gz """ +from base64 import b64decode from collections import defaultdict from copy import copy import io @@ -217,7 +218,7 @@ def populate_pkg(dbpkg, repopkg, force=False, timestamp=None): dbpkg.packager_str = repopkg.packager # attempt to find the corresponding django user for this string dbpkg.packager = finder.find(repopkg.packager) - dbpkg.pgp_signature = repopkg.pgpsig + dbpkg.signature_bytes = b64decode(repopkg.pgpsig.encode('utf-8')) if timestamp: dbpkg.last_update = timestamp diff --git a/main/migrations/0066_move_signature_data.py b/main/migrations/0066_move_signature_data.py new file mode 100644 index 0000000..75fcfa9 --- /dev/null +++ b/main/migrations/0066_move_signature_data.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- +from south.db import db +from south.v2 import DataMigration +from django.db import models +from base64 import b64decode, b64encode + +class Migration(DataMigration): + + def forwards(self, orm): + pkgs = orm.Package.objects.only( + 'id', 'pgp_signature', 'signature_bytes').all() + for pkg in pkgs: + if not pkg.pgp_signature: + continue + pkg.signature_bytes = b64decode(pkg.pgp_signature.encode('utf-8')) + pkg.save() + + def backwards(self, orm): + pkgs = orm.Package.objects.only( + 'id', 'pgp_signature', 'signature_bytes').all() + for pkg in pkgs: + if not pkg.signature_bytes: + continue + pkg.pgp_signature = b64encode(pkg.signature_bytes).decode('utf-8') + pkg.save() + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + u'main.arch': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Arch', 'db_table': "'arches'"}, + 'agnostic': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'required_signoffs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '2'}) + }, + u'main.donor': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Donor', 'db_table': "'donors'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) + }, + u'main.package': { + 'Meta': {'ordering': "('pkgname',)", 'unique_together': "(('pkgname', 'repo', 'arch'),)", 'object_name': 'Package', 'db_table': "'packages'"}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'on_delete': 'models.PROTECT', 'to': u"orm['main.Arch']"}), + 'build_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'compressed_size': ('main.fields.PositiveBigIntegerField', [], {}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'files_last_update': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'flag_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'installed_size': ('main.fields.PositiveBigIntegerField', [], {}), + 'last_update': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'packager': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}), + 'packager_str': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pgp_signature': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgdesc': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'pkgname': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'on_delete': 'models.PROTECT', 'to': u"orm['main.Repo']"}), + 'signature_bytes': ('django.db.models.fields.BinaryField', [], {'null': 'True'}), + 'url': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) + }, + u'main.packagefile': { + 'Meta': {'object_name': 'PackageFile', 'db_table': "'package_files'"}, + 'directory': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_directory': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['main.Package']"}) + }, + u'main.repo': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Repo', 'db_table': "'repos'"}, + 'bugs_category': ('django.db.models.fields.SmallIntegerField', [], {'default': '2'}), + 'bugs_project': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'staging': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'svn_root': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + } + } + + complete_apps = ['main'] + symmetrical = True diff --git a/main/models.py b/main/models.py index 91f1483..70872c6 100644 --- a/main/models.py +++ b/main/models.py @@ -1,4 +1,3 @@ -from base64 import b64decode from datetime import datetime from itertools import groupby from pgpdump import BinaryData @@ -141,13 +140,9 @@ class Package(models.Model): @property def signature(self): - try: - data = b64decode(self.pgp_signature.encode('utf-8')) - except TypeError: - return None - if not data: + if not self.signature_bytes: return None - data = BinaryData(data) + data = BinaryData(self.signature_bytes) packets = list(data.packets()) return packets[0] -- cgit v1.2.3-24-g4f1b From 071bd6bd71f681c45048fc0a0961e58d43d44d48 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Nov 2013 22:08:01 -0600 Subject: Drop old base64-ed PGP signature column We've moved onto bytes only now. Signed-off-by: Dan McGee --- devel/views.py | 2 +- ...0065_auto__add_field_package_signature_bytes.py | 1 - .../0067_auto__del_field_package_pgp_signature.py | 113 +++++++++++++++++++++ main/models.py | 1 - 4 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 main/migrations/0067_auto__del_field_package_pgp_signature.py diff --git a/devel/views.py b/devel/views.py index fe7fdf8..731827f 100644 --- a/devel/views.py +++ b/devel/views.py @@ -274,7 +274,7 @@ def report(request, report_name, username=None): cutoff = timedelta(hours=24) filtered = [] packages = packages.select_related( - 'arch', 'repo', 'packager').filter(pgp_signature__isnull=False) + 'arch', 'repo', 'packager').filter(signature_bytes__isnull=False) known_keys = DeveloperKey.objects.select_related( 'owner').filter(owner__isnull=False) known_keys = {dk.key: dk for dk in known_keys} diff --git a/main/migrations/0065_auto__add_field_package_signature_bytes.py b/main/migrations/0065_auto__add_field_package_signature_bytes.py index 95c596c..a954166 100644 --- a/main/migrations/0065_auto__add_field_package_signature_bytes.py +++ b/main/migrations/0065_auto__add_field_package_signature_bytes.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models diff --git a/main/migrations/0067_auto__del_field_package_pgp_signature.py b/main/migrations/0067_auto__del_field_package_pgp_signature.py new file mode 100644 index 0000000..8c1d9b7 --- /dev/null +++ b/main/migrations/0067_auto__del_field_package_pgp_signature.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + db.delete_column('packages', 'pgp_signature') + + def backwards(self, orm): + db.add_column('packages', 'pgp_signature', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=True) + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + u'main.arch': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Arch', 'db_table': "'arches'"}, + 'agnostic': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'required_signoffs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '2'}) + }, + u'main.donor': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Donor', 'db_table': "'donors'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) + }, + u'main.package': { + 'Meta': {'ordering': "('pkgname',)", 'unique_together': "(('pkgname', 'repo', 'arch'),)", 'object_name': 'Package', 'db_table': "'packages'"}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'on_delete': 'models.PROTECT', 'to': u"orm['main.Arch']"}), + 'build_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'compressed_size': ('main.fields.PositiveBigIntegerField', [], {}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'files_last_update': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'flag_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'installed_size': ('main.fields.PositiveBigIntegerField', [], {}), + 'last_update': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'packager': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}), + 'packager_str': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgdesc': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'pkgname': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'on_delete': 'models.PROTECT', 'to': u"orm['main.Repo']"}), + 'signature_bytes': ('django.db.models.fields.BinaryField', [], {'null': 'True'}), + 'url': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) + }, + u'main.packagefile': { + 'Meta': {'object_name': 'PackageFile', 'db_table': "'package_files'"}, + 'directory': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_directory': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['main.Package']"}) + }, + u'main.repo': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Repo', 'db_table': "'repos'"}, + 'bugs_category': ('django.db.models.fields.SmallIntegerField', [], {'default': '2'}), + 'bugs_project': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'staging': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'svn_root': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + } + } + + complete_apps = ['main'] diff --git a/main/models.py b/main/models.py index 70872c6..3f96408 100644 --- a/main/models.py +++ b/main/models.py @@ -108,7 +108,6 @@ class Package(models.Model): packager_str = models.CharField('packager string', max_length=255) packager = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL) - pgp_signature = models.TextField('PGP signature', null=True, blank=True) signature_bytes = models.BinaryField('PGP signature', null=True) flag_date = models.DateTimeField(null=True, blank=True) -- cgit v1.2.3-24-g4f1b