Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Django 1.9 #28

Merged
merged 1 commit into from
Jan 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions address/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from django.db import models
from django.core.exceptions import ValidationError
from django.db.models.fields.related import ForeignObject, ReverseSingleRelatedObjectDescriptor
from django.db.models.fields.related import ForeignObject
try:
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor
except ImportError:
from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor as ForwardManyToOneDescriptor
from django.utils.encoding import python_2_unicode_compatible

import logging
Expand Down Expand Up @@ -269,7 +273,7 @@ def as_dict(self):
ad['country_code'] = self.locality.state.country.code
return ad

class AddressDescriptor(ReverseSingleRelatedObjectDescriptor):
class AddressDescriptor(ForwardManyToOneDescriptor):

def __set__(self, inst, value):
super(AddressDescriptor, self).__set__(inst, to_python(value))
Expand Down