Misc cleanup, adjustemnts to ids to make mapping easier.

This commit is contained in:
DJ Gillespie 2020-06-03 18:56:04 -06:00
parent 3689004a82
commit f89295e000
4 changed files with 6 additions and 1 deletions

View File

@ -136,7 +136,7 @@ USE_I18N = True
USE_L10N = True USE_L10N = True
USE_TZ = True USE_TZ = False
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)

View File

@ -666,8 +666,11 @@ transactions = [
] ]
print(len(transactions))
for transaction in transactions: for transaction in transactions:
bank = Bank.objects.filter(acc_id=transaction.get("account_id",[None]))[0] bank = Bank.objects.filter(acc_id=transaction.get("account_id",[None]))[0]
print(bank)
if bank: if bank:
fields = { fields = {
"datetime":datetime.strptime(transaction.get("date"),"%Y-%m-%d"), "datetime":datetime.strptime(transaction.get("date"),"%Y-%m-%d"),

View File

@ -71,6 +71,7 @@ class Slice(models.Model):
limit_choices_to=avail_parents, limit_choices_to=avail_parents,
on_delete=models.CASCADE) on_delete=models.CASCADE)
parent_id = models.PositiveIntegerField() parent_id = models.PositiveIntegerField()
is_unsliced = models.BooleanField(default=False)
slice_of = GenericForeignKey('parent_type', 'parent_id') slice_of = GenericForeignKey('parent_type', 'parent_id')
@property @property
@ -116,6 +117,7 @@ class Transaction(models.Model):
Bank = models.ForeignKey(Bank, on_delete=models.CASCADE, Bank = models.ForeignKey(Bank, on_delete=models.CASCADE,
related_name='transactions') related_name='transactions')
details = jsonfield.JSONField() details = jsonfield.JSONField()
Slice = models.ForeignKey(Slice, on_delete=models.SET_NULL, null=True)
@property @property
def qid(self): def qid(self):