Module ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list Assign NameStore Dict Str Str Str ListLoad Str Str Str Str Str Str Str Str Str Str Num Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Return Dict Str Str Str NameLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad NameLoad Index Str If CompareIn NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str body Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign SubscriptStore NameLoad Index Str SubscriptLoad Call NameLoad NameLoad Slice NameLoad Return Call AttributeLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr keyword NameLoad keyword NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam defaults body FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad Call NameLoad NameLoad Str attr Assign NameStore AttributeLoad NameLoad attr Return BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list If NameLoad body Return Call NameLoad keyword NameLoad keyword NameLoad orelse Return Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list If NameLoad body Return Call NameLoad NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameStore ListLoad Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot NameLoad body Return Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign NameStore Dict Str NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Assign NameStore SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Call NameLoad NameLoad If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr DictComp SubscriptLoad NameLoad Index Str TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If CompareIs NameLoad NameLoad body Return NameLoad orelse If NameLoad body Return SubscriptLoad NameLoad Index NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIn NameLoad NameLoad body Return SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str Raise Call NameLoad BinOpMod Str TupleLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults vararg body If BoolOpAnd AttributeLoad NameLoad attr CompareIn NameLoad NameLoad body Raise Call NameLoad Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body If AttributeLoad NameLoad attr body Raise Call NameLoad Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpAdd Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Dict keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Expr Str If AttributeLoad NameLoad attr body Raise Call NameLoad Str If UnaryOpNot NameLoad body Assign NameStore NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assert Call NameLoad NameLoad NameLoad Assign NameStore BinOpBitAnd Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr If NameLoad body Raise Call NameLoad BinOpMod Str Call AttributeLoad Str attr NameLoad AugAssignAdd AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad With Call AttributeLoad NameLoad attr NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Str kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad Return BinOpAdd Call AttributeLoad Str attr NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareIs NameLoad NameLoad body Assign NameStore Str orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Dict If UnaryOpNot NameLoad body Return NameLoad For NameStore Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Continue If CompareNotIn AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Call NameLoad Str TupleLoad Call NameLoad NameLoad AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Call NameLoad Str Assign NameStore TupleLoad NameLoad FunctionDef arguments args NameParam NameParam defaults Str vararg kwarg body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body TryExcept body Return Call NameLoad NameLoad keyword AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIs NameLoad NameLoad body Return Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr If CompareNotEq AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list
N/A django.core.exceptions ValidationError os path fs_path time strftime django.utils.text slugify django.utils six django.utils.translation ugettext _ django.core.cache cache django.conf settings django.db models collections OrderedDict N/A N/A django.utils.deconstruct deconstructible N/A N/A N/A ImportError N/A deconstructible N/A N/A old_class N/A N/A N/A old_class N/A N/A UPLOAD_TO_OPTIONS N/A black_listed_extensions max_filename_length file_name_template N/A php html htm js vbs py pyc asp aspx pl 40 {model_name}/%Y/{filename}.{extension} UploadTo N/A object N/A N/A 
    An instance of this class is passed as "upload_to" parameter for any FileField or ImageField
    It ensures file name is less than "max_filename_length" char also slugify the filename and finally provide simple
    protection against uploading some harmful files like (php or python files)

    File is saved in a folder called <model_name>/<current_year>/file_name.ext
    example: User/2015/profile_pic.jpg
     __init__ N/A N/A self N/A kwargs N/A N/A 
        :param kwargs: You can override any of the default options by passing it as keyword argument to this function
        :return:
         N/A N/A self options N/A N/A UPLOAD_TO_OPTIONS copy N/A N/A hasattr settings UPLOAD_TO_OPTIONS N/A N/A N/A N/A N/A self options update N/A settings UPLOAD_TO_OPTIONS N/A N/A N/A N/A self options update kwargs N/A get_file_info N/A N/A full_filename N/A N/A N/A filename N/A N/A N/A N/A fs_path basename full_filename lower N/A N/A filename file_ext N/A N/A filename rsplit . 1 N/A N/A filename extension full_filename filename file_ext full_filename N/A staticmethod validate_file_info N/A N/A self file_info N/A N/A N/A file_ext N/A file_info N/A extension N/A N/A file_ext N/A N/A self options N/A black_listed_extensions N/A N/A N/A ValueError N/A File extension '%s' is not allowed file_ext N/A generate_file_name N/A N/A self instance file_info N/A N/A N/A model_name N/A N/A instance __class__ __name__ N/A filename N/A file_info N/A filename N/A max_len N/A N/A self options N/A max_filename_length N/A N/A file_info N/A filename N/A N/A slugify filename N/A max_len N/A N/A N/A N/A strftime N/A N/A self options N/A file_name_template format model_name model_name instance instance file_info N/A __call__ N/A N/A self instance full_filename N/A N/A N/A 
        :param instance: model instance which the file is uploaded for
        :param full_filename: filename including its path
        :return: string
         N/A full_filename N/A N/A six text_type full_filename N/A file_info N/A N/A self get_file_info full_filename N/A N/A N/A self validate_file_info file_info N/A N/A N/A self generate_file_name instance file_info N/A N/A deconstructible upload_to N/A N/A instance full_filename N/A N/A N/A upload_to_obj N/A UploadTo N/A N/A upload_to_obj instance full_filename N/A cached_model_property N/A N/A model_method readonly cache_timeout N/A None True None N/A N/A 
    cached_model_property is a decorator for model functions that takes no arguments
    The function is converted into a property that support caching out of the box

    :param readonly: set readonly parameter False to make the property writeable
    :type readonly: bool
    :param cache_timeout: number of seconds before cache expires
    :type cache_timeout: int

    Sample usage:

    class Team(models.Model):

        @cached_model_property
        def points(self):
            # Do complex DB queries
            return result

        @cached_model_property(readonly=False)
        def editable_points(self):
            # get result
            return result

    Now try
    team = Team.objects.first()
    team.points  <-- complex DB queries will happen, result will be returned
    team.points  <-- this time result is returned from cache (points function is not called at all!
    del team.points <-- points value has been removed from cache
    team.points  <-- complex DB queries will happen, result will be returned

    set readonly parameter False to make the property writeable
    team.editable_points = 88
    in this case the assigned value will replace the value stored in the cache
    team.editable_points
    returns 88
     func N/A N/A f N/A N/A _get_cache_key N/A N/A obj N/A N/A N/A 
            :type obj: django.db.models.Model
            :rtype: six.string_types
             N/A model_name N/A N/A getattr obj _meta db_table N/A method_name N/A f __name__ N/A N/A %s.%s.%s N/A model_name N/A obj pk method_name N/A get_x N/A N/A obj N/A N/A N/A cache_key N/A _get_cache_key obj N/A result N/A N/A cache get cache_key N/A N/A result None N/A N/A result N/A f obj N/A N/A set_x obj result N/A result N/A del_x N/A N/A obj N/A N/A N/A 
            Remove that property from the cache
            :param obj:
            :return: None
             N/A cache_key N/A _get_cache_key obj N/A N/A N/A cache delete cache_key N/A set_x N/A N/A obj value N/A N/A N/A 
            Set the cache value of that property
            :param obj:
            :return: None
             N/A cache_key N/A _get_cache_key obj N/A N/A cache_timeout None N/A N/A N/A N/A cache set cache_key value N/A N/A N/A N/A cache set cache_key value cache_timeout N/A N/A readonly N/A N/A N/A property fget get_x fdel del_x N/A N/A N/A property fget get_x fset set_x fdel del_x N/A N/A model_method N/A N/A N/A func model_method N/A func N/A Choices N/A OrderedDict N/A N/A 
    Offer a cleaner way for django choices field

    Usage:

    ** define a constant **
    ANIMAL_TYPES = Choices(
    [
        {"insect": 1,
        {"mammal": {"id": 2}, # same as {"mammal": 2}
        {"none": {"id": None, "display": "Not Animal"},
    ])

    ** Inside your model class **

    animal_type = models.IntegerField(choices=ANIMAL_TYPES(), null=True)

    output of ANIMAL_TYPES() is django choice list ordered by display name:
    [(1, 'Insect'), (2, 'Mammal'), (None, 'Not Animal')]

    ** Using the new model **
    animal = Animals.objects.first()
    if animal.animal_type == ANIMAL_TYPES.insect:
        # do the insect related code

     N/A _read_only True N/A _choices_id None __init__ N/A N/A self choices order_by N/A display N/A N/A 

        :param choices: dictionary of dictionary . ex: {'choice1': {'id':1, 'display': 'Code One'}, ...}
        display key is optional. if not provided its assumed to be dict_key.replace("_", " ").capitalize()
        :type choices: Choices | OrderedDict | dict | tuple | list
        :param order_by: Whether generated Django choice list should be ordered (valid options "id", "display", None)
        :type  order_by: str | None
         N/A N/A self _read_only False N/A N/A N/A N/A super Choices self __init__ choices N/A N/A self _choices _choices N/A N/A N/A self _order_by order_by N/A N/A choices N/A N/A N/A choice_ids N/A set N/A N/A choice_code choice_options N/A N/A self items N/A N/A N/A N/A issubclass N/A choice_options __class__ dict N/A N/A choice_options N/A id choice_options N/A N/A self N/A choice_code choice_options N/A choice_id N/A choice_options N/A id N/A N/A N/A choice_ids add choice_id N/A N/A display choice_options N/A N/A N/A choice_options N/A display N/A N/A N/A N/A choice_code replace _ capitalize N/A display N/A choice_options N/A display N/A N/A N/A _choices append N/A choice_id N/A _ display N/A N/A order_by display N/A N/A N/A N/A _choices sort key N/A N/A N/A x N/A N/A x N/A 1 N/A N/A N/A order_by id N/A N/A N/A N/A _choices sort key N/A N/A N/A x N/A N/A x N/A 0 N/A N/A self _read_only True N/A get_display_name N/A N/A self choice_id N/A N/A N/A 
        Return translated display name of certain choice.
        same same model's get_<field_name>_display()
        :param choice_id: choice id
        :rtype: str
         N/A N/A N/A self get_value choice_id display N/A get_value N/A N/A self choice_id choice_key raise_exception N/A True N/A N/A 
        Finds a choice with id <choice_id> and return value of key <key>

        :param choice_id: the db value of the choice in question
        :param choice_key: the key inside choice dictionary in which you want to get value of
        :param raise_exception: if True, KeyError exception will be raised if the key wasn't found
        :return: whatever stored in that choice key is returned,
                 if key not found and raise_exception=False then None is returned
         N/A N/A N/A self _choices_id None N/A N/A N/A self _choices_id N/A N/A item N/A id N/A key item N/A N/A key item N/A N/A six iteritems self N/A N/A choice_name choice N/A N/A self _choices_id N/A choice_id N/A N/A choice_key None N/A N/A choice_name N/A N/A raise_exception N/A N/A N/A choice N/A choice_key N/A N/A N/A N/A choice get choice_key N/A get_code_name N/A N/A self choice_id N/A N/A N/A 
        Return code name of certain choice
        :param choice_id: choice id
        :rtype: str
         N/A N/A N/A self get_value choice_id choice_key None N/A __getattr__ N/A N/A self attr_name N/A N/A N/A N/A attr_name self N/A N/A N/A N/A self N/A attr_name N/A id N/A N/A AttributeError N/A Attribute %s is not part of %s class N/A attr_name N/A N/A self __class__ __name__ N/A __call__ N/A N/A self N/A N/A N/A 
        :return: list of choices
        :rtype: list
         N/A N/A self _choices N/A __setattr__ N/A N/A self attr N/A args N/A N/A N/A N/A self _read_only N/A attr self N/A N/A N/A TypeError Choices are constants and can't be modified N/A N/A N/A N/A super Choices self __setattr__ attr args N/A __setitem__ N/A N/A self N/A args N/A N/A N/A self _read_only N/A N/A N/A TypeError Choices are constants and can't be modified N/A N/A N/A N/A super Choices self __setitem__ args N/A __dir__ N/A N/A self N/A N/A N/A N/A N/A list N/A N/A self keys N/A dir N/A self __class__ N/A copy N/A N/A self N/A N/A N/A new_self N/A Choices N/A order_by N/A self _order_by N/A N/A N/A new_self update self N/A new_self N/A update N/A N/A self new_data N/A None kwargs N/A N/A 
        :type new_data: Choices | OrderedDict | dict | tuple | list
         N/A N/A self _read_only N/A N/A N/A TypeError Choices are constants and can't be modified N/A N/A new_data N/A N/A new_data kwargs N/A N/A N/A isinstance new_data Choices N/A N/A new_data N/A Choices new_data N/A N/A isinstance new_data Choices N/A common_keys N/A N/A set N/A N/A new_data keys N/A set N/A N/A self keys N/A common_keys N/A N/A N/A ValueError N/A The following keys exist in both instances %s N/A N/A ,  join common_keys N/A N/A self _choices N/A new_data N/A N/A self _choices_id None N/A N/A N/A N/A super Choices self update new_data N/A __enter__ N/A N/A self N/A N/A N/A self N/A __exit__ N/A N/A self N/A args kwargs N/A N/A N/A self _read_only True N/A __add__ N/A N/A self other N/A N/A N/A N/A self _read_only False N/A N/A N/A self copy result N/A N/A N/A N/A result update other N/A N/A self _read_only True N/A result N/A N/A KeyValueContainer N/A dict N/A __init__ N/A N/A self seq separator N/A None = kwargs N/A N/A N/A N/A N/A super KeyValueContainer self __init__ N/A N/A self sep separator N/A N/A isinstance seq N/A six string_types N/A N/A seq N/A N/A self _parse_string seq N/A N/A seq None N/A N/A seq N/A dict seq N/A N/A N/A kwargs update seq N/A N/A key value N/A N/A six iteritems kwargs N/A N/A N/A N/A self __setitem__ key value N/A __str__ N/A N/A self N/A N/A N/A result N/A N/A N/A key val N/A N/A six iteritems self N/A N/A N/A N/A result append N/A %s %s %s N/A key N/A self sep val N/A N/A N/A N/A join result N/A __setitem__ N/A N/A self key item N/A N/A N/A N/A item None N/A N/A item N/A N/A item N/A N/A six text_type item N/A N/A N/A N/A super KeyValueContainer self __setitem__ key item N/A __unicode__ N/A N/A self N/A N/A N/A N/A N/A self __str__ N/A _parse_string N/A N/A self value N/A N/A N/A result N/A N/A N/A value N/A N/A result N/A line N/A N/A value split N/A N/A line N/A N/A line strip N/A N/A line N/A N/A N/A N/A N/A self sep line N/A N/A N/A ValueError N/A N/A _ Invalid syntax in line %s
Expected: key %s value N/A N/A repr line N/A self sep N/A N/A key value N/A N/A N/A val strip N/A val N/A N/A line split N/A self sep 1 N/A N/A result N/A key value N/A result N/A N/A KeyValueField N/A N/A models TextField N/A N/A 
    Basically a way to store configuration in DB and have it returned as dictionary.
    Simple key/value store
    data stored as
    key = value
    default separator is "=" but it can be customized

    sample usage

    class MyModel(models.Model):
         options = KeyValueField(separator=":")

    >> my_model.options = "key1 : val1 
 key2 : val2"
    >> my_model.clean_fields()
    >> my_model.options
    {"key1": "val1", "key2": "val2"}
     N/A description N/A _ Key/Value dictionary field N/A empty_values N/A None __init__ N/A N/A self separator N/A = args kwargs N/A N/A N/A self separator separator N/A N/A N/A N/A super KeyValueField self __init__ args kwargs N/A contribute_to_class N/A N/A self cls name N/A kwargs N/A N/A N/A N/A N/A super KeyValueField self contribute_to_class cls name kwargs N/A N/A setattr cls name N/A property fget N/A self get_value fset N/A self set_value N/A set_value N/A N/A self obj value N/A N/A N/A N/A isinstance value N/A six string_types N/A N/A value N/A N/A self from_db_value value N/A N/A N/A N/A isinstance value KeyValueContainer N/A N/A value N/A KeyValueContainer value N/A N/A N/A obj __dict__ N/A N/A self name value N/A get_value N/A N/A self obj N/A N/A N/A N/A N/A obj __dict__ N/A N/A self name N/A from_db_value N/A N/A self value N/A args kwargs N/A N/A N/A N/A N/A KeyValueContainer value separator N/A self separator N/A N/A N/A ValueError N/A e N/A N/A N/A ValidationError e N/A get_prep_value N/A N/A self value N/A N/A N/A N/A value None N/A N/A N/A N/A N/A six text_type value N/A deconstruct N/A N/A self N/A N/A N/A N/A name path args kwargs N/A N/A N/A super KeyValueField self deconstruct N/A N/A N/A self separator = N/A N/A N/A kwargs N/A separator N/A self separator N/A N/A name path args kwargs N/A N/A