#NEWLINE# def register( self , * args , **kwargs ) : #NEWLINE# #INDENT# from django.db import models #NEWLINE# sequere = None #NEWLINE# model = None #NEWLINE# assert ( len ( args ) <= 2 ) , 'register takes at most 2 args' #NEWLINE# assert ( len ( args ) > 0 ) , 'register takes at least 1 arg' #NEWLINE# for arg in args : #NEWLINE# #INDENT# if issubclass ( arg , models . Model ) : #NEWLINE# #INDENT# model = arg #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sequere = arg #NEWLINE# #UNINDENT# #UNINDENT# if model : #NEWLINE# #INDENT# self . _register_model ( model , sequere , ** kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# name = kwargs . get ( 'name' , sequere . __name__ ) #NEWLINE# sequere = type ( name , ( sequere , ) , kwargs ) #NEWLINE# self . _register ( sequere )