a
    Šxd  ã                   @   s@   d dl mZmZ zeeƒjZW n ey0   Y n0 ddd„ZdS )é    )ÚDistributionNotFoundÚget_distributionNÚhistoryc                 K   sf   ddl m} |du r|j}|f i |¤Ž}||_||_|r@d| pD| j|_| |_| | ¡ | 	| ¡ dS )a=  
    Create historical model for `model` and attach history manager to `model`.

    Keyword arguments:
    app -- App to install historical model into (defaults to model.__module__)
    manager_name -- class attribute name to use for historical manager
    records_class -- class to use for history relation (defaults to
        HistoricalRecords)
    table_name -- Custom name for history table (defaults to
        'APPNAME_historicalMODELNAME')

    This method should be used as an alternative to attaching an
    `HistoricalManager` instance directly to `model`.
    é   )ÚmodelsNz	%s.models)
Ú r   ZHistoricalRecordsÚmanager_nameÚ
table_nameÚ
__module__ÚmoduleÚclsZadd_extra_methodsÚfinalize)ÚmodelZappr   Zrecords_classr	   Zrecords_configr   Úrecords© r   úO/var/www/html/Ranjet/env/lib/python3.9/site-packages/simple_history/__init__.pyÚregister
   s    
r   )Nr   NN)Úpkg_resourcesr   r   Ú__name__ÚversionÚ__version__r   r   r   r   r   Ú<module>   s       û