]> git.0d.be Git - chloro.git/blobdiff - chloro/phyll/models.py
add initial model
[chloro.git] / chloro / phyll / models.py
diff --git a/chloro/phyll/models.py b/chloro/phyll/models.py
new file mode 100644 (file)
index 0000000..587859d
--- /dev/null
@@ -0,0 +1,30 @@
+# chloro - personal space
+# Copyright (C) 2019  Frederic Peters
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from django.db import models, transaction
+from django.utils.translation import ugettext_lazy as _
+from taggit.managers import TaggableManager
+
+from .fields import RichTextField
+
+
+class Note(models.Model):
+    title = models.CharField(_('Title'), max_length=150)
+    slug = models.SlugField(_('Slug'), max_length=150)
+    text = RichTextField(_('Text'), blank=True, null=True)
+    tags = TaggableManager(_('Tags'), blank=True)
+    creation_timestamp = models.DateTimeField(auto_now_add=True)
+    last_update_timestamp = models.DateTimeField(auto_now=True)