Graybyt3 Was Here
Linux cloud.locucionar.com 3.10.0-1160.81.1.el7.x86_64 #1 SMP Fri Dec 16 17:29:43 UTC 2022 x86_64
Apache
91.191.211.241
/
opt
/
alt
/
python38
/
lib64
/
python3.8
/
site-packages
/
playhouse
/
__pycache__
[ HOME ]
Exec
Submit
gfk.cpython-38.opt-1.pyc
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__� �/gfk.pyr '