PEP8 on Operation model

This commit is contained in:
Ludovic Stephan 2017-03-25 10:43:02 -03:00
parent f645121fb1
commit 9a081ddae0

View file

@ -522,7 +522,7 @@ class OperationGroup(models.Model):
class Operation(models.Model): class Operation(models.Model):
PURCHASE = 'purchase' PURCHASE = 'purchase'
DEPOSIT = 'deposit' DEPOSIT = 'deposit'
WITHDRAW = 'withdraw' WITHDRAW = 'withdraw'
INITIAL = 'initial' INITIAL = 'initial'
EDIT = 'edit' EDIT = 'edit'
@ -536,34 +536,34 @@ class Operation(models.Model):
) )
group = models.ForeignKey( group = models.ForeignKey(
OperationGroup, on_delete = models.PROTECT, OperationGroup, on_delete=models.PROTECT,
related_name = "opes") related_name="opes")
type = models.CharField( type = models.CharField(
choices = TYPE_ORDER_CHOICES, choices=TYPE_ORDER_CHOICES,
max_length = choices_length(TYPE_ORDER_CHOICES)) max_length=choices_length(TYPE_ORDER_CHOICES))
amount = models.DecimalField( amount = models.DecimalField(
max_digits = 6, decimal_places = 2, max_digits=6, decimal_places=2,
blank = True, default = 0) blank=True, default=0)
# Optional # Optional
article = models.ForeignKey( article = models.ForeignKey(
Article, on_delete = models.PROTECT, Article, on_delete=models.PROTECT,
related_name = "operations", related_name="operations",
blank = True, null = True, default = None) blank=True, null=True, default=None)
article_nb = models.PositiveSmallIntegerField( article_nb = models.PositiveSmallIntegerField(
blank = True, null = True, default = None) blank=True, null=True, default=None)
canceled_by = models.ForeignKey( canceled_by = models.ForeignKey(
Account, on_delete = models.PROTECT, Account, on_delete=models.PROTECT,
related_name = "+", related_name="+",
blank = True, null = True, default = None) blank=True, null=True, default=None)
canceled_at = models.DateTimeField( canceled_at = models.DateTimeField(
blank = True, null = True, default = None) blank=True, null=True, default=None)
addcost_for = models.ForeignKey( addcost_for = models.ForeignKey(
Account, on_delete = models.PROTECT, Account, on_delete=models.PROTECT,
related_name = "addcosts", related_name="addcosts",
blank = True, null = True, default = None) blank=True, null=True, default=None)
addcost_amount = models.DecimalField( addcost_amount = models.DecimalField(
max_digits = 6, decimal_places = 2, max_digits=6, decimal_places=2,
blank = True, null = True, default = None) blank=True, null=True, default=None)
@property @property
def is_checkout(self): def is_checkout(self):
@ -584,6 +584,7 @@ class Operation(models.Model):
article=self.article, article=self.article,
amount=self.amount) amount=self.amount)
class GlobalPermissions(models.Model): class GlobalPermissions(models.Model):
class Meta: class Meta:
managed = False managed = False