jpwatts / django-positions

A Django field for custom model ordering.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: '>=' not supported between instances of 'int' and 'CombinedExpression'

SultanSGillani opened this issue · comments

On an update to an instance receiving this error:

Django 2.0.4
Django rest Framework 3.8.2

On Partially updating the model class

TypeError: '>=' not supported between instances of 'int' and 'CombinedExpression'
   # new instance; appended; no cleanup required on post_save
        if add and (updated == -1 or updated >= max_position):
            setattr(model_instance, cache_name, (max_position, None))
            return max_position
Open an interactive python shell in this frame 
        if max_position >= updated >= min_position:
            # positive position; valid index
            position = updated
        elif updated > max_position:
            # positive position; invalid index
            position = max_position