jpwatts / django-positions

A Django field for custom model ordering.
BSD 3-Clause "New" or "Revised" License
284 stars 71 forks source link

Django 2.1+ compatibility (tests for 2.2.6) #66

Open willstott101 opened 5 years ago

willstott101 commented 5 years ago

Previously this Field responded with an attribute error when access directly from the class:

>>> Node.position
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/wstott/repos/django-positions/positions/fields.py", line 144, in __get__
    raise AttributeError("%s must be accessed via instance." % self.name)
AttributeError: position must be accessed via instance.

Django admin now relies on the following behaviour:

>>> from examples.nodes.models import *
>>> Node.position
<positions.fields.PositionField: position>
>>> Node.name
<django.db.models.query_utils.DeferredAttribute object at 0x7f6c6b2e9748>
willstott101 commented 4 years ago

ping: Anything I can do to help get this merged?

berinhard commented 4 years ago

Hi @jpwatts do you still maintain this project? I'd love to have @willstott101 features since it's now a more reliable fork IMHO.