You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718
  1. """
  2. Field-like classes that aren't really fields. It's easier to use objects that
  3. have the same attributes as fields sometimes (avoids a lot of special casing).
  4. """
  5. from django.db.models import fields
  6. class OrderWrt(fields.IntegerField):
  7. """
  8. A proxy for the _order database field that is used when
  9. Meta.order_with_respect_to is specified.
  10. """
  11. def __init__(self, *args, **kwargs):
  12. kwargs['name'] = '_order'
  13. kwargs['editable'] = False
  14. super().__init__(*args, **kwargs)