<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import datetime


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0011_auto_20150505_0008'),
    ]

    operations = [
        migrations.AddField(
            model_name='logcontent',
            name='state',
            field=models.CharField(default=datetime.datetime(2015, 5, 7, 20, 11, 42, 875000), max_length=10),
            preserve_default=False,
        ),
    ]
<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0006_auto_20150504_1403'),
    ]

    operations = [
        migrations.RenameField(
            model_name='logcontent',
            old_name='Value',
            new_name='value',
        ),
        migrations.AlterField(
            model_name='log',
            name='log_contents',
            field=models.TextField(),
        ),
        migrations.AlterField(
            model_name='log',
            name='pub_date',
            field=models.DateTimeField(auto_now_add=True),
        ),
    ]
<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Information',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('info_type', models.CharField(max_length=200)),
                ('priority', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Space',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('space_name', models.CharField(max_length=200)),
                ('pub_date', models.DateTimeField(verbose_name=b'date published')),
            ],
        ),
        migrations.AddField(
            model_name='information',
            name='space',
            field=models.ForeignKey(to='LogTool.Space'),
        ),
    ]
<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0014_auto_20150509_0102'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='state',
            name='log',
        ),
        migrations.AddField(
            model_name='log',
            name='state',
            field=models.CharField(default=b'Todo', max_length=15, choices=[(b'TODO', b'Todo'), (b'IN_PROGRESS', b'In progress'), (b'DONE', b'Done')]),
        ),
        migrations.AddField(
            model_name='log',
            name='text',
            field=models.TextField(blank=True),
        ),
        migrations.AlterField(
            model_name='log',
            name='pub_date',
            field=models.DateTimeField(default=django.utils.timezone.now),
        ),
        migrations.DeleteModel(
            name='State',
        ),
    ]
<file_sep>from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    # Examples:
    # url(r'^$', 'DayLog.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^logtool/', include('LogTool.urls',
    namespace='logtool')),
]
<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import datetime


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0010_auto_20150504_2354'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='logcontent',
            name='pub_date',
        ),
        migrations.AddField(
            model_name='log',
            name='pub_date',
            field=models.DateTimeField(default=datetime.datetime(2015, 5, 5, 0, 8, 3, 928000), verbose_name=b'Date published'),
            preserve_default=False,
        ),
    ]
<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0007_auto_20150504_1408'),
    ]

    operations = [
        migrations.AlterField(
            model_name='log',
            name='log_contents',
            field=models.TextField(max_length=500),
        ),
    ]
<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0013_auto_20150508_1350'),
    ]

    operations = [
        migrations.CreateModel(
            name='State',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('state', models.CharField(max_length=15, choices=[(b'TODO', b'To do'), (b'IN_PROGRESS', b'In progress'), (b'DONE', b'Done')])),
                ('log', models.ForeignKey(to='LogTool.Log')),
            ],
        ),
        migrations.RemoveField(
            model_name='logcontent',
            name='state',
        ),
    ]
<file_sep>from datetime import datetime
from django.shortcuts import render, redirect, get_object_or_404
from django.utils import timezone

from .forms import LogForm
from .models import Log

def index(request):
    logs = Log.objects.filter(start_date__lte=timezone.now()).order_by('start_date')
    #for log in logs


    #time_left = _days_left(end_date)
    return render(request, 'LogTool/index.html', {'logs':  logs})

def log_new(request):
    if request.method == "POST":
        form = LogForm(request.POST)
        if form.is_valid():
            log = form.save(commit=False)
            log.save()
            return redirect('LogTool.views.index')
    else:
        form = LogForm()
    return render(request, 'LogTool/log_edit.html', {'form': form})

def log_detail(request, pk):
    log = get_object_or_404(Log, pk=pk)
    return render(request, 'LogTool/log_edit.html', {'log': log})

def _days_left(end_date):
    end_date - datetime.now()
<file_sep>from django.conf.urls import url

from . import views

urlpatterns = [
url(r'^$', views.index, name='index'),
#url(r'^log/new_log/$', views.log_new, name='log_new'),
]<file_sep>from django.contrib import admin
from .models import Log, LogContent

class LogInline(admin.TabularInline):
    model = LogContent
    extra = 1

class LogAdmin(admin.ModelAdmin):
    fieldsets = [
        ('Name it',      {'fields': ['log_name']}),
        ('Time issued',     {'fields': ['start_date'],
                             'classes': ['collapse']}),
        ]
    inlines = [LogInline]
    list_display = ['log_name', 'start_date']
    list_filter = ['start_date']
    search_fields = ['question_text']

admin.site.register(Log, LogAdmin)
admin.site.register(LogContent)
# Register your models here.
<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0012_logcontent_state'),
    ]

    operations = [
        migrations.AlterField(
            model_name='logcontent',
            name='state',
            field=models.CharField(default=1, max_length=2, choices=[(1, b'To do'), (2, b'In progress'), (3, b'Done')]),
        ),
    ]
<file_sep># DayLog

This project - web application is about storing all your daily activities , tasks and everything what matters for you.
Also it will include to do function when, where and what you need to do or accomplish tomorrow or any time in the future ... or past .
DayLog will be fast, simple and very useful tool for everyday use.
I have made a research of what people want and need and have an abstract concept of how this application will look like. I am planning to have first version in few weeks.
This application will be my first pancake built with Django but I hope it wont be the worst ..
Wish me luck :)


Functions:

* Date/time
* Description
* Importance / value
* State (done, predicted, ongoing, to do)
* Duration

Look:

* One page application
* Text field where to log
* Table
* Status bar


Objects:
    Log(name , date_published, state)
functionality
    add_log, edit_log(change description, change state), remove_log
UI
    table of logs sorted by states(each state has its own color)
    1. add button
    2. Pop up window when pressed on a new or existing log.
        On this window all information of log is displayed.
<file_sep>from django.db import models
from django.utils import timezone


#
STATE_CHOICES = (
    ('TODO', 'Todo'),
    ('IN_PROGRESS', 'In progress'),
    ('DONE', 'Done'),
    )

class Log(models.Model):
    log_name = models.CharField(max_length=30)
    start_date = models.DateTimeField(default=timezone.now)
    end_date = models.DateTimeField(default=timezone.now)
    text = models.TextField(blank=True)
    state = models.CharField(
        default='Todo',
        max_length=15,
        choices=STATE_CHOICES,
    )

    def log_save(self):
        self.start_date = timezone.now()
        self.save()

    def __str__(self):
        return self.log_name

class LogContent(models.Model):
    log = models.ForeignKey(Log)
    log_contents = models.TextField()
    value = models.IntegerField(default=0)

    def __str__(self):
        return self.log<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import datetime


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0008_auto_20150504_1414'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='log',
            name='log_contents',
        ),
        migrations.RemoveField(
            model_name='log',
            name='pub_date',
        ),
        migrations.RemoveField(
            model_name='logcontent',
            name='info_list',
        ),
        migrations.AddField(
            model_name='logcontent',
            name='log_contents',
            field=models.TextField(default=datetime.datetime(2015, 5, 4, 23, 35, 53, 25000)),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='logcontent',
            name='pub_date',
            field=models.DateTimeField(default=datetime.datetime(2015, 5, 4, 23, 35, 59, 586000), auto_now_add=True),
            preserve_default=False,
        ),
    ]
<file_sep>from django import forms
from .models import Log


class LogForm(forms.ModelForm):

    class Meta:
        model = Log
        fields = ('log_name', 'text', 'state')

<file_sep># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
        ('LogTool', '0009_auto_20150504_2335'),
    ]

    operations = [
        migrations.AlterField(
            model_name='logcontent',
            name='pub_date',
            field=models.DateTimeField(verbose_name=b'Date published'),
        ),
    ]
