You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using django-positions PositionField on the model. Adding tracker = FieldTracker() causes the following exception to run at runtime preventing the server from starting
File"F:\Projects\myproj\venv\lib\site-packages\model_utils\tracker.py", line338, infinalize_classdescriptor=getattr(sender, field_name)
File"F:\Projects\myproj\venv\lib\site-packages\positions\fields.py", line144, in__get__raiseAttributeError("%s must be accessed via instance."%self.name)
AttributeError: display_ordermustbeaccessedviainstance.
The text was updated successfully, but these errors were encountered:
iarp
changed the title
FieldTracker.finalize_class raises AttributeError when used with PositionField
FieldTracker.finalize_class raises AttributeError when used with django-positions PositionField
Aug 13, 2023
Problem
Using django-positions
PositionField
on the model. Addingtracker = FieldTracker()
causes the following exception to run at runtime preventing the server from startingPositionField.__get__
raises AttributeError if you attempt to getattr on its field as seen here https://github.com/jpwatts/django-positions/blob/master/positions/fields.py#L142I was able to fix this by changing FieldTrackers use of
descriptor = getattr(sender, field_name)
todescriptor = getattr(sender, field_name, None)
I'm unsure which package should be the one to update though.
Environment
Code examples
The text was updated successfully, but these errors were encountered: