Package: django-datebook
IntroductionDjango datebook is.. a datebook !This aims to manage user datebooks by months. A datebook contain day entries where you can add details, start and stop working hours, vacation, etc..This does not aims to reproduce some advanced apps like Google calendar or alike, datebook is simple and will have a particular workflow for our needs atEmencia.LinksDownload hisPyPi package;Clone it on hisGithub repository;RequiresDjango>=1.7, <1.8;autobreadcrumbs>= 1.0, <2.0.0;django-braces>= 1.2.0,<1.4;crispy-forms-foundation>= 0.5.3;Arrow;OptionnallyIf you want to use the shippedText markupintegration :rstview>= 0.2, <0.4.0;Django-CodeMirror>= 0.9.7, <1.0.0;Southusage has been dropped in favor of Django migrations;InstallInstall it from PyPi:pip install django-datebookAdd it to your installed apps in settings :INSTALLED_APPS = (
    ...
    'django_assets',
    'crispy_forms',
    'crispy_forms_foundation',
    'autobreadcrumbs',
    'datebook',
    ...
)Append context processor in settings :TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    'autobreadcrumbs.context_processors.AutoBreadcrumbsContext',
    ...
)Add required settings (into your project settings):# Add 'foundation-5' layout packCRISPY_ALLOWED_TEMPLATE_PACKS=('bootstrap','uni_form','bootstrap3','foundation-5')# Default layout to use with "crispy_forms"CRISPY_TEMPLATE_PACK='foundation-5'fromdatebook.settingsimport*(Also you can override some of its settings, seedatebook.settingsfor more details).Then in yoururls.py:from django.conf.urls import patterns, include, url
import autobreadcrumbs
autobreadcrumbs.autodiscover()

urlpatterns = patterns('',
    url(r'^datebook/', include('datebook.urls', namespace='datebook')),
)Finally you will need to read Django-datebook templates to know about required
template blocks and inheritance in your project templates.Text markupDefault behavior configured in settings is to not use any Markup syntax usage.But if you want you can configure some settings to use a Markup syntax renderer and a form field to use a specific editor.This can be done with the following settings:# Text markup rendererDATEBOOK_TEXT_MARKUP_RENDER=None# Default, no renderer# Field helper for texts in formsDATEBOOK_TEXT_FIELD_HELPER_PATH=None# Default, just a CharField# Template to init some Javascript for texts in formsDATEBOOK_TEXT_FIELD_JS_TEMPLATE=None# Default, no JS template# Validator helper for texts in formsDATEBOOK_TEXT_VALIDATOR_HELPER_PATH=None# Default, no markup validationThey are the default values in the datebook settings.ExplanationsDATEBOOK_TEXT_FIELD_HELPER_PATHa function that will be used to define a form field to use for text.Signature isget_text_field(form_instance, **kwargs)where:form_instanceis the Form instance where it will be used from;kwargsis a dict containing all default named arguments to give to the field. These default arguments arelabelfor the field label name andrequiredthat isTrue(you should never change this);This should return an instanciated form field that must act as aCharField.DATEBOOK_TEXT_VALIDATOR_HELPER_PATHA function that will be used to clean value on the form field text;Signature isclean_restructuredtext(form_instance, content)where:form_instanceis the Form instance where it will be used from;contentis the value to validate;Act like a Django form field cleaner method, this should return the cleaned value and eventually raise a validation error if needed.DATEBOOK_TEXT_MARKUP_RENDER_TEMPLATEA template to include to render text value with some markup syntax. It will have access to the page context with an additional value namedcontentthat will be the text to render;DATEBOOK_TEXT_FIELD_JS_TEMPLATEA template to include with forms when your custom form field require some Javascript to initialize it. It will have access to page context with an additional value namedfieldthat will be the targeted form field;All these settings are only used with forms and template managingDatebook.notesandDayBase.contentmodels attributes.ExampleThere are the settings to use the shipped Markup syntax renderer and editor, disabled by default but that you can easily enable in your settings:# Field helper for texts in formsDATEBOOK_TEXT_FIELD_HELPER_PATH="datebook.markup.get_text_field"# Use DjangoCodeMirror# Validator helper for texts in formsDATEBOOK_TEXT_VALIDATOR_HELPER_PATH="datebook.markup.clean_restructuredtext"# Validation for RST syntax (with Rstview)# Template to init some Javascript for texts in formsDATEBOOK_TEXT_FIELD_JS_TEMPLATE="datebook/markup/_text_field_djangocodemirror_js.html"# Use DjangoCodeMirror# Text markup rendererDATEBOOK_TEXT_MARKUP_RENDER_TEMPLATE="datebook/markup/_text_markup_render.html"# Use Rstview rendererRead their source code to see how they work in detail.WarningBefore enabling these settings you must installrstviewandDjango-CodeMirror, see optional requirements to have the right versions to install.UsageDatebooks are monthlyso each datebook object represents a unique month for a specific year. Anddatebook contains day entrieswhere you can fill start and stop time, eventually the pause time and some optional text content to describe day activities.For day entries,start and stop time represents times for starting and ending work, they will determine the worked time for the day.Pause time represents the time that was not worked between start/stop timeand so will be substracted from the total worked time.Overtime represents the extra time that is over the working hours, it does not affect the worked time.Day entries can be marked asvacation,vacated days will never be used to calculate the total worked timefor the month and their content is hided if any.Also, future days (days that are bigger or equal to the current day) are not used to calculate month totals (worked hours, overtime and vacations).PermissionsAt least to access to datebook views, users have to be logged in, there is no anonymous access.Basic users can see all datebooks and can read their day entries, but they can’t add or edit datebooks that they don’t own and quite naturally they can’t add/edit day entries only on their own datebooks.For admin management there is some available permissions :‘Can add datebook’ : used to create datebook for any user;‘Can change datebook’ : used to edit datebook for any user;‘Can add day entry’ : used to create day entries for any user’s datebook;‘Can change day entry’ : used to change day entries for any user’s datebook;Permission level object (like with django-guardian) is not planned because the goal is not to share datebook between users. Only datebook owner should edit its entry and all datebook are visible for any logged users, because a team should be aware of everyone datebooks.Day modelsOften you would need to repeatedly fill your days with the approximately same content and so to avoid this there isDay models.You can create aDay modelfrom an existing day in your calendars, its content will be saved as a model and then you can use it to fill any another days in your calendar.You can have multiple models, but they are allways for an unique user, models are not shareable through other users.To fill days with a model, just go into a month calendar, open the models menu, select the day to fill, select the model to use and submit, existing days will be overwrited with model contents and empty selected days will be created with the model contents.When filling days, default behavior does not use the model content text to fill the days, use the checkbox within the assignment form to use it.CreditsCollaboratorsslothyrulezfor Spanish translation;For the “Sun umbrella” icon in webfontIcon made byFreepikfromwww.flaticon.comis licensed underCC BY 3.0.Other icons in webfontComes from various sets onIcoMoon.