jpwatts / django-positions

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

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

Closed SultanSGillani closed 6 years ago

SultanSGillani commented 6 years ago

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