first base of project-changed apps: Herd-livestock-tag-log-elasticsearch- remove mongo engine

This commit is contained in:
2025-05-24 15:23:09 +03:30
parent 5a92736f25
commit d4afc780ea
2 changed files with 17 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
import time
from .models import Log
# from .models import Log
from tinydb import TinyDB, Query
from django.core import serializers
from datetime import datetime

View File

@@ -1,16 +1,16 @@
from django.db import models
from apps.core.models import BaseModel
from mongoengine import Document, fields
# Create your models here.
class Log(Document):
endpoint = fields.StringField(max_length=100, null=True) # The url the user requested
user = fields.StringField(max_length=200, null=True)
response_code = fields.IntField(default=0) # Response status code
method = fields.StringField(max_length=10, null=True) # Request method
remote_address = fields.StringField(max_length=20, null=True) # IP address of user
exec_time = fields.IntField(null=True) # Time taken to create the response
date = fields.DateTimeField(auto_now=True) # Date and time of request
body_response = fields.StringField(null=True) # Response data
body_request = fields.StringField(max_length=1000, null=True) # Request data
# from django.db import models
# from apps.core.models import BaseModel
# from mongoengine import Document, fields
# # Create your models here.
#
#
# class Log(Document):
# endpoint = fields.StringField(max_length=100, null=True) # The url the user requested
# user = fields.StringField(max_length=200, null=True)
# response_code = fields.IntField(default=0) # Response status code
# method = fields.StringField(max_length=10, null=True) # Request method
# remote_address = fields.StringField(max_length=20, null=True) # IP address of user
# exec_time = fields.IntField(null=True) # Time taken to create the response
# date = fields.DateTimeField(auto_now=True) # Date and time of request
# body_response = fields.StringField(null=True) # Response data
# body_request = fields.StringField(max_length=1000, null=True) # Request data