Merge pull request #645 from Gluejar/fix-deprecation-warnings

Fix deprecation warnings
pull/1/head
Raymond Yee 2016-11-14 10:15:38 -08:00 committed by GitHub
commit cb7eb01786
5 changed files with 31 additions and 6 deletions

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20160923_1314'),
]
operations = [
migrations.AlterField(
model_name='work',
name='related',
field=models.ManyToManyField(related_name='reverse_related', through='core.WorkRelation', to='core.Work', blank=True),
),
]

View File

@ -99,7 +99,7 @@ class Work(models.Model):
featured = models.DateTimeField(null=True, blank=True, db_index=True,)
is_free = models.BooleanField(default=False)
landings = GenericRelation(Landing, related_query_name='works')
related = models.ManyToManyField('self', symmetrical=False, null=True, through='WorkRelation', related_name='reverse_related')
related = models.ManyToManyField('self', symmetrical=False, blank=True, through='WorkRelation', related_name='reverse_related')
age_level = models.CharField(max_length=5, choices=AGE_LEVEL_CHOICES, default='', blank=True)
class Meta:

View File

@ -4,6 +4,7 @@
{% block extra_extra_head %}
{{ block.super }}
<link rel="stylesheet" href="/static/css/ui-lightness/jquery-ui-1.8.16.custom.css" type="text/css" media="screen">
<style type="text/css">
.group-border {
border: solid #edf3f4;
border-width: 2px;

View File

@ -5,7 +5,7 @@ from selectable.base import ModelLookup
from selectable.registry import registry
from django import forms
from django.contrib.admin import ModelAdmin
from django.contrib.admin import ModelAdmin, site
from django.contrib.auth.models import User, Group
class UserLookup(ModelLookup):
@ -47,3 +47,8 @@ class CardPatternAdmin(ModelAdmin):
class EmailPatternAdmin(ModelAdmin):
list_display = ('library', 'pattern', )
search_fields = ('library__name',)
site.register(models.Library, LibraryAdmin)
site.register(models.Block, BlockAdmin)
site.register(models.CardPattern, CardPatternAdmin)
site.register(models.EmailPattern, EmailPatternAdmin)

View File

@ -140,7 +140,7 @@ class IP(object):
if not isinstance(other, IP):
other = IP(other)
if self.int and other.int:
if self.int is not None and other.int is not None:
return self.int.__cmp__(other.int)
raise ValueError('Invalid arguments')
@ -177,7 +177,7 @@ class IPAddressFormField(BaseIPAddressField):
raise ValidationError(self.default_error_messages['invalid'],
code='invalid')
class IPAddressModelField(models.IPAddressField):
class IPAddressModelField(models.GenericIPAddressField):
__metaclass__ = models.SubfieldBase
empty_strings_allowed = False
@ -205,10 +205,10 @@ class IPAddressModelField(models.IPAddressField):
def formfield(self, **kwargs):
defaults = {'form_class': IPAddressFormField}
defaults.update(kwargs)
return super(models.IPAddressField, self).formfield(**defaults)
return super(models.GenericIPAddressField, self).formfield(**defaults)
def deconstruct(self):
name, path, args, kwargs = super(models.IPAddressField, self).deconstruct()
name, path, args, kwargs = super(models.GenericIPAddressField, self).deconstruct()
return name, path, args, kwargs
class Block(models.Model):