Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merging in the fix from @akinfold as well as another that was giving a

bug on relationships.clear() due to a missing 'through'...good to go
passing on 1.3 and 1.4
  • Loading branch information...
commit 6eec835a76f19c0560c2987c0f9653a02440d558 1 parent c4b264c
@coleifer authored
Showing with 14 additions and 6 deletions.
  1. +3 −2 relationships/models.py
  2. +11 −4 runtests.py
View
5 relationships/models.py
@@ -271,11 +271,12 @@ class RelationshipsDescriptor(object):
def __get__(self, instance, instance_type=None):
manager = RelatedManager(
model=User,
- query_field_name='related_to__pk',
+ query_field_name='related_to',
instance=instance,
symmetrical=False,
source_field_name='from_user',
- target_field_name='to_user'
+ target_field_name='to_user',
+ through=Relationship,
)
return manager
View
15 runtests.py
@@ -14,13 +14,20 @@
db_name = ''
if not settings.configured:
+ if django.VERSION < (1, 4):
+ tl = (
+ 'django.template.loaders.filesystem.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source',
+ )
+ else:
+ tl = (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+ )
settings.configure(
DATABASES=dict(default=dict(ENGINE=db_engine, NAME=db_name)),
SITE_ID = 1,
- TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.load_template_source',
- 'django.template.loaders.app_directories.load_template_source',
- ),
+ TEMPLATE_LOADERS = tl,
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
Please sign in to comment.
Something went wrong with that request. Please try again.