python - Django mptt throwing error when order insertion value is changed -
i have mptt model:
class program_requirement_category(mpttmodel): display_order = models.integerfield(null=true, blank=true) name = models.charfield(max_length=100, unique=false) min_credit = models.integerfield(null=true, blank=true) max_credit = models.integerfield(null=true, blank=true) parent = treeforeignkey('self', null=true, blank=true, related_name='children') class mpttmeta: order_insertion_by = ['display_order']
when try insert value db, following error:
file "/home/abhishek/projects/mptttree/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1074, in build_filter raise valueerror("cannot use none query value") valueerror: cannot use none query value
i referred this question , wanted similar work around problem well. how around this?
from mptt documentation:
order_insertion_by list of field names should define ordering when new tree nodes being inserted or existing nodes being reparented, significant ordering field name first. defaults []. it assumed field identified defining ordering never null in database.
Comments
Post a Comment