Server IP : 192.158.238.246 / Your IP : 3.145.82.96 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python38/lib64/python3.8/site-packages/playhouse/__pycache__/ |
Upload File : |
U S��W� � @ s� d Z ddlT ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ e � Z i ZG dd � d e�ZG d d� deee��Zdd � ZG dd� de �ZG dd� de �ZG dd� de �ZdS )a Provide a "Generic ForeignKey", similar to Django. A "GFK" is composed of two columns: an object ID and an object type identifier. The object types are collected in a global registry (all_models), so all you need to do is subclass ``gfk.Model`` and your model will be added to the registry. Example: class Tag(Model): tag = CharField() object_type = CharField(null=True) object_id = IntegerField(null=True) object = GFKField('object_type', 'object_id') class Blog(Model): tags = ReverseGFK(Tag, 'object_type', 'object_id') class Photo(Model): tags = ReverseGFK(Tag, 'object_type', 'object_id') tag.object -> a blog or photo blog.tags -> select query of tags for ``blog`` instance Blog.tags -> select query of all tags for Blog instances � )�*)� BaseModel)�Model)�SelectQuery)�UpdateQuery)�with_metaclassc s e Zd Z� fdd�Z� ZS )r c s, t t| ��| |||�} |dkr(t�| � | S )N)Z_metaclass_helper_r )�superr �__new__� all_models�add)�cls�name�basesZattrs�� __class__� �@/opt/alt/python38/lib64/python3.8/site-packages/playhouse/gfk.pyr '