Programming API LookupValue

Navigate

    A lookup value is a pre-defined accepted value for a LookupField or MuiltipleLookupField.

    Attributes

    Parameter Type Description
    id int Identifies the lookup value in the database.
    name string Short title of the value.
    status string Status of the field, must be one of ‘active’, ‘inactive’, deleted.
    symbol File An image file that is used to display value of that lookup.
    field LookupField / MultipleLookupField Field this value is assigned to.

    Methods

    delete()

    Deletes the value by setting its status to inactive.

    Create a new instance

    LookupField

    from geokey.categories.models import LookupValue
    LookupValue.objects.create(name=name, field=field)
    

    MultipleLookupField

    from geokey.categories.models import MultipleLookupValue
    MultipleLookupValue.objects.create(name=name, field=field)
    
    Parameters
    name: string
    Value as displayed to the user.
    field: Field
    Field this value is assigned to.

    Accessing model instances

    get(pk=value_id)

    Parameters
    value_id: integer
    Identifies the value in the database.
    Returns

    LookupValue

    Raises
    LookupValue.DoesNotExist
    If the value of the lookup field was not found in the data base.
    MultipleLookupValue.DoesNotExist
    If the value of the multiple-lookup field was not found in the data base.
    Example
    field.lookupvalues.get(pk=2)