akaariai / django-reverse-unique

A ReverseUnique model field implementation for Django
BSD 3-Clause "New" or "Revised" License
22 stars 5 forks source link

Used the new Meta API on Django 1.8+ #8

Closed charettes closed 9 years ago

charettes commented 9 years ago

There's one remaining deprecation warning which will make the tests fail against master:

Passing callable arguments to queryset is deprecated. triggered by constructs such as Q(lang=get_language) or Q(from_date__lte=date.today).

Should we allow the filters kwarg to be a callable?

def get_active_translation_filters():
    return Q(lang=get_language())

active_translation = ReverseUnique(
    'ArticleTranslation', filters=get_active_translation_filters
)
charettes commented 9 years ago

Python 3.2 failures are unrelated, see #9.

akaariai commented 9 years ago

Yes, allowing filters to be callable is the right solution.

coveralls commented 9 years ago

Coverage Status

Changes Unknown when pulling ba350bfdb993668c19a8067c9944a7acdc1a7e70 on charettes:deprecation-warnings into \ on akaariai:master**.