From 35798c5304756c85c1ffa86892746ba732c249e8 Mon Sep 17 00:00:00 2001 From: fjrodriguez Date: Thu, 19 Jan 2023 13:43:06 -0600 Subject: [PATCH] sistemas app added --- Admin/settings.py | 3 ++- Clientes/models.py | 10 ---------- Clientes/views.py | 2 +- Sistemas/__init__.py | 0 Sistemas/admin.py | 3 +++ Sistemas/apps.py | 6 ++++++ Sistemas/migrations/__init__.py | 0 Sistemas/models.py | 28 ++++++++++++++++++++++++++++ Sistemas/tests.py | 3 +++ Sistemas/views.py | 3 +++ 10 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 Sistemas/__init__.py create mode 100644 Sistemas/admin.py create mode 100644 Sistemas/apps.py create mode 100644 Sistemas/migrations/__init__.py create mode 100644 Sistemas/models.py create mode 100644 Sistemas/tests.py create mode 100644 Sistemas/views.py diff --git a/Admin/settings.py b/Admin/settings.py index 2ecba9a..68a8206 100644 --- a/Admin/settings.py +++ b/Admin/settings.py @@ -15,7 +15,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = os.getenv("adminAS_KEY") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = True ALLOWED_HOSTS = ['*'] # Application definition @@ -36,6 +36,7 @@ INSTALLED_APPS = [ 'widget_tweaks', 'Clientes', + 'Sistemas', ] REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ diff --git a/Clientes/models.py b/Clientes/models.py index df07ecc..5e9b535 100644 --- a/Clientes/models.py +++ b/Clientes/models.py @@ -74,13 +74,3 @@ class Clientes(models.Model): ordering = ('-Activo','-conteo_mes','RFC') -class Maquinas_Conectadas(models.Model): - UserName = models.CharField(max_length=255) - PC_Name = models.CharField(max_length=255) - Is64 = models.BooleanField() - OSversion= models.CharField(max_length=255) - local_ip = models.CharField(max_length=55) - public_ip= models.CharField(max_length=55) - RFC = models.CharField(max_length=13) - class Meta: - abstract =True \ No newline at end of file diff --git a/Clientes/views.py b/Clientes/views.py index 87bbb65..97f0157 100644 --- a/Clientes/views.py +++ b/Clientes/views.py @@ -421,7 +421,7 @@ class add_timbre2(APIView): modo=request.GET.get('modo', None) obj={'uuid':uuid,'rfcc':rfcc,'fecha':fecha,'folio':folio, 'serie':serie,'tipo':tipo,'rfcp':rfcp,'modo':modo - } + } try: obj = Timbres.objects.create(**obj) return Response({'data':'ok'}) diff --git a/Sistemas/__init__.py b/Sistemas/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Sistemas/admin.py b/Sistemas/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/Sistemas/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Sistemas/apps.py b/Sistemas/apps.py new file mode 100644 index 0000000..0b7f7bc --- /dev/null +++ b/Sistemas/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class SistemasConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'Sistemas' diff --git a/Sistemas/migrations/__init__.py b/Sistemas/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Sistemas/models.py b/Sistemas/models.py new file mode 100644 index 0000000..8518ee8 --- /dev/null +++ b/Sistemas/models.py @@ -0,0 +1,28 @@ +from django.db import models + +from Clientes.models import Clientes +# Create your models here. + +class Sistema(models.Model): + nombre_sistema= models.CharField(max_length=100, blank=False,null=False,unique=True) + # class Meta: + # abstract=True + +class sistemas_por_cliente(models.Model): + id_sistema= models.ForeignKey(Sistema, related_name='sistema_spc', on_delete=models.CASCADE) + cliente = models.ForeignKey(Clientes, related_name='cliente_spc', on_delete=models.CASCADE) + num_licencias= models.IntegerField(default=1) + + # class Meta: + # abstract = True + +class Maquinas_Conectadas(models.Model): + UserName = models.CharField(max_length=255) + PC_Name = models.CharField(max_length=255) + Is64 = models.BooleanField() + OSversion= models.CharField(max_length=255) + local_ip = models.CharField(max_length=55) + public_ip= models.CharField(max_length=55) + RFC = models.CharField(max_length=13) + class Meta: + abstract =True \ No newline at end of file diff --git a/Sistemas/tests.py b/Sistemas/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/Sistemas/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Sistemas/views.py b/Sistemas/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/Sistemas/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.