sistemas app added

This commit is contained in:
fjrodriguez
2023-01-19 13:43:06 -06:00
parent cc8cd4d792
commit 35798c5304
10 changed files with 46 additions and 12 deletions

View File

@@ -15,7 +15,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = os.getenv("adminAS_KEY") SECRET_KEY = os.getenv("adminAS_KEY")
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False DEBUG = True
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
# Application definition # Application definition
@@ -36,6 +36,7 @@ INSTALLED_APPS = [
'widget_tweaks', 'widget_tweaks',
'Clientes', 'Clientes',
'Sistemas',
] ]
REST_FRAMEWORK = { REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [ 'DEFAULT_AUTHENTICATION_CLASSES': [

View File

@@ -74,13 +74,3 @@ class Clientes(models.Model):
ordering = ('-Activo','-conteo_mes','RFC') 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

View File

@@ -421,7 +421,7 @@ class add_timbre2(APIView):
modo=request.GET.get('modo', None) modo=request.GET.get('modo', None)
obj={'uuid':uuid,'rfcc':rfcc,'fecha':fecha,'folio':folio, obj={'uuid':uuid,'rfcc':rfcc,'fecha':fecha,'folio':folio,
'serie':serie,'tipo':tipo,'rfcp':rfcp,'modo':modo 'serie':serie,'tipo':tipo,'rfcp':rfcp,'modo':modo
} }
try: try:
obj = Timbres.objects.create(**obj) obj = Timbres.objects.create(**obj)
return Response({'data':'ok'}) return Response({'data':'ok'})

0
Sistemas/__init__.py Normal file
View File

3
Sistemas/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
Sistemas/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class SistemasConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Sistemas'

View File

28
Sistemas/models.py Normal file
View File

@@ -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

3
Sistemas/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
Sistemas/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.