# HG changeset patch # User ymh # Date 1498047165 -7200 # Node ID 75dc1e794cf4544009dc9b2719c46916599b930b # Parent dff58e6bea479853984b77882449fc9dcc8ed3e1 add date field on session object diff -r dff58e6bea47 -r 75dc1e794cf4 src/notes/api/serializers/core.py --- a/src/notes/api/serializers/core.py Wed Jun 21 08:45:29 2017 +0200 +++ b/src/notes/api/serializers/core.py Wed Jun 21 14:12:45 2017 +0200 @@ -34,7 +34,7 @@ class Meta: model = Session fields = ( - 'ext_id', 'version', 'created', 'updated', + 'ext_id', 'version', 'date', 'created', 'updated', 'owner', 'title', 'description', 'protocol' ) read_only_fields = ('ext_id', 'version', 'created', 'updated', 'owner') @@ -48,7 +48,7 @@ class Meta: model = Session fields = ( - 'ext_id', 'version', 'created', 'updated', + 'ext_id', 'version', 'date', 'created', 'updated', 'owner', 'title', 'description', 'protocol', 'notes' ) @@ -62,7 +62,7 @@ class Meta: model = Session fields = ( - 'ext_id', 'version', 'created', 'updated', + 'ext_id', 'version', 'date', 'created', 'updated', 'owner', 'title', 'description', 'protocol' ) read_only_fields = ('version', 'created', 'updated', 'owner') diff -r dff58e6bea47 -r 75dc1e794cf4 src/notes/locale/en/LC_MESSAGES/django.mo Binary file src/notes/locale/en/LC_MESSAGES/django.mo has changed diff -r dff58e6bea47 -r 75dc1e794cf4 src/notes/locale/en/LC_MESSAGES/django.po --- a/src/notes/locale/en/LC_MESSAGES/django.po Wed Jun 21 08:45:29 2017 +0200 +++ b/src/notes/locale/en/LC_MESSAGES/django.po Wed Jun 21 14:12:45 2017 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-08 15:29+0000\n" +"POT-Creation-Date: 2017-06-21 10:51+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -60,98 +60,102 @@ msgid "Protocol|title" msgstr "title" -#: models/category.py:16 +#: models/category.py:18 msgid "Protocol" msgstr "Protocol" -#: models/category.py:17 +#: models/category.py:19 msgid "Protocols" msgstr "Protocols" -#: models/category.py:22 +#: models/category.py:23 msgid "Category|title" msgstr "title" -#: models/category.py:23 +#: models/category.py:24 msgid "Category|color" msgstr "color" -#: models/category.py:24 +#: models/category.py:27 msgid "Category|need_comment" msgstr "need comment" -#: models/category.py:25 +#: models/category.py:32 msgid "Category|description" msgstr "description" -#: models/category.py:28 +#: models/category.py:36 msgid "Category|protocol" msgstr "protocol" -#: models/category.py:33 +#: models/category.py:42 msgid "Category" msgstr "Category" -#: models/category.py:34 +#: models/category.py:43 msgid "Categories" msgstr "Categories" -#: models/core.py:13 +#: models/core.py:17 msgid "Session" msgstr "Session" -#: models/core.py:14 +#: models/core.py:18 msgid "Sessions" msgstr "Sessions" #: models/core.py:20 +msgid "Session|date" +msgstr "date" + +#: models/core.py:29 msgid "Session|title" msgstr "title" -#: models/core.py:21 +#: models/core.py:34 msgid "Session|description" msgstr "description" -#: models/core.py:22 +#: models/core.py:39 msgid "Session|protocol" msgstr "protocol" -#: models/core.py:26 +#: models/core.py:48 msgid "Note" msgstr "Note" -#: models/core.py:27 +#: models/core.py:49 msgid "Notes" msgstr "Notes" -#: models/core.py:30 +#: models/core.py:52 msgid "Note|tc_start" msgstr "start timecode" -#: models/core.py:31 +#: models/core.py:53 msgid "Note|tc_end" msgstr "end timeocde" -#: models/core.py:32 +#: models/core.py:58 msgid "Note|session" msgstr "session" -#: models/core.py:33 +#: models/core.py:63 msgid "Note|plain" msgstr "text plain" -#: models/core.py:34 +#: models/core.py:68 msgid "Note|html" msgstr "text html" -#: models/core.py:35 +#: models/core.py:73 msgid "Note|raw" msgstr "text raw" -#: models/core.py:36 +#: models/core.py:78 msgid "Note|margin_note" msgstr "margin note" -#: models/core.py:37 +#: models/core.py:83 msgid "Note|categorization" msgstr "categorization" diff -r dff58e6bea47 -r 75dc1e794cf4 src/notes/locale/fr/LC_MESSAGES/django.mo Binary file src/notes/locale/fr/LC_MESSAGES/django.mo has changed diff -r dff58e6bea47 -r 75dc1e794cf4 src/notes/locale/fr/LC_MESSAGES/django.po --- a/src/notes/locale/fr/LC_MESSAGES/django.po Wed Jun 21 08:45:29 2017 +0200 +++ b/src/notes/locale/fr/LC_MESSAGES/django.po Wed Jun 21 14:12:45 2017 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-08 15:29+0000\n" +"POT-Creation-Date: 2017-06-21 10:51+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -61,98 +61,102 @@ msgid "Protocol|title" msgstr "titre" -#: models/category.py:16 +#: models/category.py:18 msgid "Protocol" msgstr "Protocole" -#: models/category.py:17 +#: models/category.py:19 msgid "Protocols" msgstr "Protocoles" -#: models/category.py:22 +#: models/category.py:23 msgid "Category|title" msgstr "titre" -#: models/category.py:23 +#: models/category.py:24 msgid "Category|color" msgstr "couleur" -#: models/category.py:24 +#: models/category.py:27 msgid "Category|need_comment" msgstr "a un commentaire" -#: models/category.py:25 +#: models/category.py:32 msgid "Category|description" msgstr "description" -#: models/category.py:28 +#: models/category.py:36 msgid "Category|protocol" msgstr "protocole" -#: models/category.py:33 +#: models/category.py:42 msgid "Category" msgstr "Categorie" -#: models/category.py:34 +#: models/category.py:43 msgid "Categories" msgstr "Categories" -#: models/core.py:13 +#: models/core.py:17 msgid "Session" msgstr "Session" -#: models/core.py:14 +#: models/core.py:18 msgid "Sessions" msgstr "Sessions" #: models/core.py:20 +msgid "Session|date" +msgstr "date" + +#: models/core.py:29 msgid "Session|title" msgstr "titre" -#: models/core.py:21 +#: models/core.py:34 msgid "Session|description" msgstr "description" -#: models/core.py:22 +#: models/core.py:39 msgid "Session|protocol" msgstr "protocole" -#: models/core.py:26 +#: models/core.py:48 msgid "Note" msgstr "Note" -#: models/core.py:27 +#: models/core.py:49 msgid "Notes" msgstr "Notes" -#: models/core.py:30 +#: models/core.py:52 msgid "Note|tc_start" msgstr "timecode début" -#: models/core.py:31 +#: models/core.py:53 msgid "Note|tc_end" msgstr "timecode fin" -#: models/core.py:32 +#: models/core.py:58 msgid "Note|session" msgstr "session" -#: models/core.py:33 +#: models/core.py:63 msgid "Note|plain" msgstr "texte seul" -#: models/core.py:34 +#: models/core.py:68 msgid "Note|html" msgstr "texte html" -#: models/core.py:35 +#: models/core.py:73 msgid "Note|raw" msgstr "texte brut" -#: models/core.py:36 +#: models/core.py:78 msgid "Note|margin_note" msgstr "note de marge" -#: models/core.py:37 +#: models/core.py:83 msgid "Note|categorization" msgstr "catégorisation" diff -r dff58e6bea47 -r 75dc1e794cf4 src/notes/migrations/0001_initial.py --- a/src/notes/migrations/0001_initial.py Wed Jun 21 08:45:29 2017 +0200 +++ b/src/notes/migrations/0001_initial.py Wed Jun 21 14:12:45 2017 +0200 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.11.2 on 2017-06-13 11:53 +# Generated by Django 1.11.2 on 2017-06-21 10:50 from __future__ import unicode_literals import colorful.fields @@ -119,6 +119,7 @@ ('updated', models.DateTimeField(auto_now=True, verbose_name='Model|updated')), ('ext_id', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='Model|ext_id')), ('version', concurrency.fields.AutoIncVersionField(default=1, help_text='record revision number', verbose_name='Model|version')), + ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Session|date')), ('title', models.TextField(blank=True, null=True, verbose_name='Session|title')), ('description', models.TextField(blank=True, null=True, verbose_name='Session|description')), ('protocol', models.TextField(blank=True, null=True, verbose_name='Session|protocol')), diff -r dff58e6bea47 -r 75dc1e794cf4 src/notes/models/core.py --- a/src/notes/models/core.py Wed Jun 21 08:45:29 2017 +0200 +++ b/src/notes/models/core.py Wed Jun 21 14:12:45 2017 +0200 @@ -3,16 +3,22 @@ """ from django.conf import settings from django.db import models +from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from .base import Model class Session(Model): + """ + Class modeling a Session + """ class Meta: verbose_name = _('Session') verbose_name_plural = _('Sessions') + date = models.DateTimeField(default=timezone.now, verbose_name=_('Session|date')) + owner = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, @@ -35,6 +41,9 @@ class Note(Model): + """ + Class nodeling a Note + """ class Meta: verbose_name = _('Note') verbose_name_plural = _('Notes')