$30 GRAYBYTE WORDPRESS FILE MANAGER $74

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model/

HOME
Current File : /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model//__init__.py
from peewee import IntegrityError, Model as BaseModel


class Model(BaseModel):
    """
    Common Model class that fix create_or_get method with using CompositeKey.
    https://stackoverflow.com/questions/35167628/peewee-create-or-get-error-in-model-with-compositekey
    """

    @classmethod
    def create_or_get(cls, **kwargs):
        try:
            with cls._meta.database.atomic():
                return cls.create(**kwargs), True
        except IntegrityError:
            query = []
            for field_name, value in kwargs.items():
                field = getattr(cls, field_name)
                field_is_primary_key = (
                    field.name in cls._meta.primary_key.field_names
                    if cls._meta.composite_key
                    else field.primary_key
                )
                if field.unique or field_is_primary_key:
                    query.append(field == value)
            return cls.get(*query), False

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.25 PM
root / root
0755
__pycache__
--
16 Dec 2025 9.25 PM
root / root
0755
__init__.py
0.94 KB
16 Oct 2025 7.33 PM
root / root
0644
analyst_cleanup.py
3.401 KB
16 Oct 2025 7.33 PM
root / root
0644
event_hook.py
1.741 KB
16 Oct 2025 7.33 PM
root / root
0644
icontact.py
1.155 KB
16 Oct 2025 7.33 PM
root / root
0644
infected_domain.py
4.236 KB
16 Oct 2025 7.33 PM
root / root
0644
instance.py
0.47 KB
16 Oct 2025 7.33 PM
root / root
0644
messages_to_send.py
1.371 KB
16 Oct 2025 7.33 PM
root / root
0644
simplification.py
5.013 KB
16 Oct 2025 7.33 PM
root / root
0644
tls_check.py
1.289 KB
16 Oct 2025 7.33 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF