class Item(WishlistBase): store = models.ForeignKey( 'Store', on_delete=models.PROTECT, ) platform = models.ForeignKey( 'Platform', on_delete=models.PROTECT, ) series = models.ForeignKey( 'Series', on_delete=models.PROTECT, blank=True, null=True, ) type = models.ForeignKey( 'Type', on_delete=models.PROTECT, ) name = models.CharField(max_length=64) position = positions.PositionField() objects = positions.PositionManager('position') url = models.URLField(blank=True) price = models.DecimalField(max_digits=6, decimal_places=2) image = models.ImageField(upload_to='wishlist/item/images/') def pos(self): return self.position + 1
class Item(models.Model): description = models.CharField(max_length=50) position = positions.PositionField() objects = positions.PositionManager() def __unicode__(self): return self.description
class SponsorCategory(models.Model): name = models.CharField(max_length=255) order = positions.PositionField() objects = positions.PositionManager() class Meta: ordering = ['order'] def __unicode__(self): return self.name
class Item(models.Model): description = models.CharField(max_length=50) # I'm calling the PositionField "index" to make sure any internal code that # relies on a PositionField being called "position" will break. # https://github.com/jpwatts/django-positions/pull/12 index = positions.PositionField() objects = positions.PositionManager('index') def __unicode__(self): return self.description
class Faq(models.Model): title = models.CharField(max_length=255) content = models.TextField() order = positions.PositionField() objects = positions.PositionManager() class Meta: ordering = ['order'] def __unicode__(self): return self.title