V1.30 notification
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from .customer import Customer
|
||||
from .exercises import Exercises
|
||||
from .exercise_type import ExerciseType
|
||||
from .frequent_customers import FrequentCustomers
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
class Sport(models.Model):
|
||||
sport_id = models.AutoField(primary_key = True)
|
||||
language_code = models.CharField(max_length=2,default="hu")
|
||||
sport_name = models.CharField(max_length=100)
|
||||
|
||||
class Meta:
|
||||
db_table = 'sport_translation'
|
||||
|
||||
from aitrainer_backoffice.models.sports import Sport
|
||||
|
||||
class Customer(models.Model):
|
||||
customer_id = models.BigAutoField(primary_key=True)
|
||||
@@ -21,6 +12,7 @@ class Customer(models.Model):
|
||||
fitness_level = models.CharField(max_length=20)
|
||||
date_add = models.DateField()
|
||||
synced_date = models.DateTimeField(blank=True,null=True)
|
||||
firebase_reg_token = models.CharField(max_length=255, blank=True, null=True)
|
||||
|
||||
def has_add_permission(self, request):
|
||||
return False
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from ..models.exercises import Exercises
|
||||
|
||||
|
||||
class ExerciseType(models.Model):
|
||||
exercise_type_id = models.AutoField(primary_key=True)
|
||||
name = models.CharField(max_length=50)
|
||||
active = models.BooleanField()
|
||||
|
||||
|
||||
def has_add_permission(self, request):
|
||||
return False
|
||||
|
||||
def has_delete_permission(self, request, obj=None):
|
||||
return False
|
||||
|
||||
@property
|
||||
def exercise_count(self):
|
||||
count = Exercises.objects.filter(exercise_type_id=self.exercise_type_id).count()
|
||||
return count
|
||||
|
||||
class Meta:
|
||||
db_table = 'exercise_type'
|
||||
verbose_name = _("Frequent Exercise")
|
||||
verbose_name_plural = _("Frequent Exercises")
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
from django.db import models
|
||||
|
||||
#from ..models.exercise_type import ExerciseType
|
||||
from ..models.customer import Customer
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
from django.db import models
|
||||
|
||||
from aitrainer_backoffice.models.notification import Notification
|
||||
from ..models import Customer
|
||||
|
||||
class NotificationHistory(models.Model):
|
||||
notification_history_id = models.AutoField(primary_key=True)
|
||||
notification = models.ForeignKey(Notification, on_delete=models.CASCADE)
|
||||
customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
|
||||
response = models.CharField(max_length=255)
|
||||
notification_date = models.DateField(blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
db_table = 'notification_history'
|
||||
app_label = 'controlling'
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.notification};{self.customer};{self.response}'
|
||||
Reference in New Issue
Block a user