Skip to content

Commit

Permalink
Merge pull request #314 from Kniyl/fill_cache
Browse files Browse the repository at this point in the history
Better support for django 1.8 (Fixes #304)
  • Loading branch information
deschler committed May 13, 2015
2 parents 15c7d9d + f23e2f7 commit 6d3c361
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modeltranslation/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ def add_translation_fields(model, opts):
# Rebuild information about parents fields. If there are opts.local_fields, field cache would be
# invalidated (by model._meta.add_field() function). Otherwise, we need to do it manually.
if len(opts.local_fields) == 0:
model._meta._fill_fields_cache()
try:
model._meta._fill_fields_cache()
except AttributeError:
# Django 1.8 removed _fill_fields_cache
model._meta._expire_cache()
model._meta.get_fields()


def has_custom_queryset(manager):
Expand Down

0 comments on commit 6d3c361

Please sign in to comment.