added HistorySync model

This commit is contained in:
Sam
2021-01-21 12:16:20 +00:00
parent 2d21bd0ef7
commit 11971b771e
4 changed files with 28 additions and 0 deletions

View File

@@ -1,3 +1,19 @@
from django.db import models
# Create your models here.
class HistorySync(models.Model):
"""
Keeps an historic record of the importation of products for a company
"""
company = models.ForeignKey('companies.Company', on_delete=models.DO_NOTHING, null=True)
rss_url = models.URLField('URL del feed', null=True, blank=True)
sync_date = models.DateTimeField('Fecha de lanzamiento', null=True)
result = models.TextField('Resultado', null=True, blank=True)
quantity = models.PositiveIntegerField('Productos importados', null=True)
# internal
created = models.DateTimeField('date of creation', auto_now_add=True)
updated = models.DateTimeField('date last update', auto_now=True)
creator = models.ForeignKey('core.CustomUser', on_delete=models.DO_NOTHING, null=True, related_name='historysync')