https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/core/management/commands/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/core/management/commands/inspectdb.pyc
�
r�\c@s�ddlmZddlZddlZddlmZddlmZmZddl	m
Z
mZddlm
Z
defd��YZdS(	i����(tunicode_literalsN(tmake_option(t
NoArgsCommandtCommandError(tconnectionstDEFAULT_DB_ALIAS(t
SortedDicttCommandcBsueZdZejeddddddedd�fZeZd	Z	d
�Z
d�Zd�Zd
�Z
d�ZRS(uXIntrospects the database tables in the given database and outputs a Django model module.u
--databasetactionustoretdestudatabasetdefaultthelpuNNominates a database to introspect.  Defaults to using the "default" database.u	django.dbcKsVy2x+|j|�D]}|jjd|�qWWntk
rQtd��nXdS(Nu%s
uPDatabase inspection isn't supported for the currently selected database backend.(thandle_inspectiontstdouttwritetNotImplementedErrorR(tselftoptionstline((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyt
handle_noargss

ccs&t|jd�}|jd�}d�}d�}|j�}dVdVdVdVd	Vd
VdVdVd
VdVdVd|jVdVg}x�|jj|�D]}}|dk	r�t|�r�||�s�q�q�nd||�V|j||��y|jj	||�}	Wnt
k
r(i}	nXy|jj||�}
Wnt
k
r[i}
nXg}x�t|jj
||��D]}\}}
g}t�}|
d}||	k}|j|||�\}}}|j|�|j|�|j|�||
kr9|
|drt|d<q9|
|dr9t|d<q9n|r�|	|d|krYdn||	|d�}||kr�d|}q�d|}nB|j|||
�\}}}|j|�|j|�|d7}|dkr|dkr|itd6krq~n|
drK|dkr%d}qKt|d<|d*krKt|d"<qKnd#||f}|r�|jd�s}|d$7}n|d$jg|j�D](\}}d%||t|��f^q��7}n|d&7}|r�|d'd(j|�7}nd)|Vq~Wx|j|�D]}|VqWq�WdS(+Nudatabaseutable_name_filtercSs.|j�jdd�jdd�jdd�S(Nu_uu u-(ttitletreplace(t
table_name((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyt<lambda>%scSs|jd�r|dS|S(Nuu'i(t
startswith(ts((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyR&su0# This is an auto-generated Django model module.u<# You'll have to do the following manually to clean this up:u#   * Rearrange models' orderu>#   * Make sure each model has one field with primary_key=Trueu_#   * Remove `managed = False` lines if you wish to allow Django to create and delete the tableuR# Feel free to rename the models, but don't rename db_table values or field names.u#uV# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'u# into your database.u'from __future__ import unicode_literalsuufrom %s import modelsuclass %s(models.Model):iuprimary_keyuuniqueiuselfu
ForeignKey(%suForeignKey('%s'u(uidu
AutoField(iu
BooleanField(uNullBooleanField(ublanku
TextField(u
CharField(unullu%s = models.%su, u%s=%su)u # u u    %s(u
TextField(u
CharField((Rtgettcursort	db_modulet
introspectionttable_namestNonetcallabletappendt
get_relationsRtget_indexest	enumeratetget_table_descriptionRtnormalize_col_nametupdatetextendtTruetget_field_typetendswithtjointitemstreprtget_meta(RRt
connectionttable_name_filterttable2modeltstrip_prefixRtknown_modelsRt	relationstindexestused_column_namestitrowt
comment_notestextra_paramstcolumn_nametis_relationtatt_nametparamstnotestrel_tot
field_typetfield_paramstfield_notest
field_desctktvt	meta_line((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyR s�			



(	




.




+
	

	?

c	Cs5i}g}|j�}||kr4|jd�n|rc|jd�rV|d }qc||d<ntjdd|�\}}|dkr�|jd�n|jd	�dkrx+|jd	�dkr�|jd	d�}q�W|j�jd	�dkr|jd
�qn|jd�r4d|}|jd�n|jd�r]d
|}|jd�ntj	|�r�|d7}|jd�n|dj
�r�d|}|jd�n||kr	d}x$d||f|kr�|d7}q�Wd||f}|jd�n||kr(|r(||d<n|||fS(uU
        Modify the column name to make it Python-compatible as a field name
        uField name made lowercase.u_idi����u	db_columnu\Wu_iu.Field renamed to remove unsuitable characters.u__u>Field renamed because it contained more than one '_' in a row.ufield%su*Field renamed because it started with '_'.u%sfieldu(Field renamed because it ended with '_'.u_fieldu4Field renamed because it was a Python reserved word.u	number_%su:Field renamed because it wasn't a valid Python identifier.u%s_%diu'Field renamed because of name conflict.(tlowerR!R+tretsubntfindRRtkeywordt	iskeywordtisdigit(	Rtcol_nameR7R=RCRDtnew_nametnum_repltnum((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyR&�sL






cCs^t�}g}y|jj|d|�}Wn$tk
rRd}|jd�nXt|�tkr�|\}}|j|�n|dkr�|dr�t|d�|d<n|dkrQ|ddks�|d	dkr2|jd
�|ddk	r|dnd|d<|d	dk	r%|d	nd	|d
<qQ|d|d<|d	|d
<n|||fS(u�
        Given the database connection, the table name, and the cursor row
        description, this routine will return the given field type name, as
        well as any additional keyword parameters and notes for the field.
        iu	TextFielduThis field type is a guess.u	CharFieldiu
max_lengthuDecimalFieldiiuamax_digits and decimal_places have been guessed, as this database handles decimal fields as floati
u
max_digitsudecimal_placesN(
RRR*tKeyErrorR!ttypettupleR'tintR(RR0RR9RCRDRBt
new_params((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyR*�s*	
 $'cCsddd|dgS(u�
        Return a sequence comprising the lines of code necessary
        to construct the inner Meta class for the model corresponding
        to the given database table name.
        u    class Meta:u        managed = Falseu        db_table = '%s'u((RR((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyR/�s(t__name__t
__module__RRtoption_listRRtFalsetrequires_model_validationRRRR&R*R/(((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyRs		f	8	&(t
__future__RRMRJtoptparseRtdjango.core.management.baseRRt	django.dbRRtdjango.utils.datastructuresRR(((sK/tmp/pip-install-XxeQeY/django/django/core/management/commands/inspectdb.pyt<module>s

https://t.me/AnonymousX5 - 2025