created json field Company.credentials, added import_products action to CompanyViewSet

This commit is contained in:
Sam
2021-02-16 13:56:47 +00:00
parent 2e33748b70
commit 0fff360b1c
2 changed files with 23 additions and 8 deletions

View File

@@ -1,12 +1,15 @@
# from django.db import models
from django.contrib.gis.db import models
from django.contrib.postgres.fields import JSONField
from django.contrib.auth import get_user_model
from tagulous.models import TagField
# from core.models import TreeTag
from history.models import HistorySync
# Create your models here.
# User = get_user_model()
class Company(models.Model):
WOO_COMMERCE = 'WOO_COMMERCE'
@@ -42,14 +45,13 @@ class Company(models.Model):
sync = models.BooleanField('Sincronizar tienda', default=False, null=True, blank=True)
is_validated = models.BooleanField('Validado', default=False, null=True, blank=True)
is_active = models.BooleanField('Activado', default=False, null=True, blank=True)
credentials = JSONField(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='creator')
# def __str__(self):
# return self.company_name
# history = models.ForeignKey(HistorySync, null=True, on_delete=models.DO_NOTHING, related_name='company')
class Meta:
verbose_name = "Compañía"