Interaction with Django
The python-semanticversion package provides two custom fields for Django:
VersionField: stores asemantic_version.VersionobjectSpecField: stores asemantic_version.BaseSpecobject
Those fields are django.db.models.CharField subclasses,
with their max_length defaulting to 200.
- class semantic_version.django_fields.VersionField[source]
Stores a
semantic_version.Versionas its string representation.- partial
Deprecated since version 2.7: Support for partial versions will be removed in 3.0.
Boolean; whether
partialversions are allowed.
- coerce
Boolean; whether passed in values should be coerced into a semver string before storing.
- class semantic_version.django_fields.SpecField[source]
Stores a
semantic_version.BaseSpecas its textual representation.- syntax
The syntax to use for the field; defaults to
'simple'.Added in version 2.7.