added bank account fk to slice
This commit is contained in:
parent
5e33e6a308
commit
e3b1060624
@ -123,14 +123,14 @@ class TransactionSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class SliceSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = Slice
|
||||
fields = ['pk', 'url', 'name', 'icon', 'balance', 'slice_of']
|
||||
fields = ['pk', 'url', 'name', 'icon', 'balance', 'slice_of', 'bank_acc']
|
||||
|
||||
|
||||
class SliceTransactionSerializer(serializers.ModelSerializer):
|
||||
transactions = TransactionSerializer(many=True, read_only=True)
|
||||
class Meta:
|
||||
model = Slice
|
||||
fields = ['pk', 'url', 'name', 'icon', 'balance', 'slice_of', 'transactions']
|
||||
fields = ['pk', 'url', 'name', 'icon', 'balance', 'slice_of', 'transactions', 'bank_acc']
|
||||
|
||||
class RuleSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
|
||||
@ -71,6 +71,7 @@ class Slice(models.Model):
|
||||
limit_choices_to=avail_parents,
|
||||
on_delete=models.CASCADE, null=True, blank=True)
|
||||
parent_id = models.PositiveIntegerField(null=True)
|
||||
bank_acc = models.ForeignKey(null=True, blank=True)
|
||||
is_unsliced = models.BooleanField(default=False)
|
||||
slice_of = GenericForeignKey('parent_type', 'parent_id')
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user