diff options
author | Raphaël Barrois <raphael.barrois@polyconseil.fr> | 2012-05-15 16:42:40 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polyconseil.fr> | 2012-05-15 16:42:40 +0200 |
commit | 6713f3071764e1438fb7e07cf51bacde8fd97394 (patch) | |
tree | 41bb5fcf99bbb143ca6cc5ad95523e7b79e71fd6 /tests/django_test_app/models.py | |
parent | 48f7cc1c811cdfb807615931a0fa3d102aa1fa90 (diff) | |
download | semantic-version-6713f3071764e1438fb7e07cf51bacde8fd97394.tar.gz |
Add django fields for SemanticVersion and Spec.
Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr>
Diffstat (limited to 'tests/django_test_app/models.py')
-rw-r--r-- | tests/django_test_app/models.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/django_test_app/models.py b/tests/django_test_app/models.py new file mode 100644 index 0000000..53ed874 --- /dev/null +++ b/tests/django_test_app/models.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2012 Raphaël Barrois + +from django.db import models +from semantic_version import django_fields as semver_fields + + +class VersionModel(models.Model): + version = semver_fields.VersionField(verbose_name='my version') + spec = semver_fields.SpecField(verbose_name='my spec') + + +class PartialVersionModel(models.Model): + partial = semver_fields.VersionField(partial=True, verbose_name='partial version') + optional = semver_fields.VersionField(verbose_name='optional version', blank=True, null=True) + optional_spec = semver_fields.SpecField(verbose_name='optional spec', blank=True, null=True) |