Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Models #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .idea/Django_To_Do.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Main/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.contrib import admin

# Register your models here.
from Main.models import Tasks

admin.site.register(Tasks)
25 changes: 25 additions & 0 deletions Main/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2.6 on 2019-10-10 09:49

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Tasks',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=50)),
('description', models.TextField()),
('created', models.DateTimeField(auto_now_add=True)),
('deadline', models.DateTimeField()),
('done', models.BooleanField(default=False)),
],
),
]
12 changes: 11 additions & 1 deletion Main/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
from django.db import models

# Create your models here.

class Tasks(models.Model):
title = models.CharField(max_length=50)
description = models.TextField()
created = models.DateTimeField(auto_now_add=True)
deadline = models.DateTimeField(required=False)
done = models.BooleanField(default=False)


def __str__(self):
return self.title
13 changes: 13 additions & 0 deletions Main/templates/tasks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<h1>TASKS</h1>

<ul>
{% for t in task %}
<li>
{{ t.title}}<br>
{{ t.description }}<br>
{{ t.created }}<br>
{{ t.deadline }}<br>
{{ t.done }}<br>
</li>
{% endfor %}
</ul>
1 change: 0 additions & 1 deletion Main/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from django.test import TestCase

# Create your tests here.
10 changes: 5 additions & 5 deletions Main/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.urls import path
from .views import index_view, login_view, signUp_view
from .views import index_view, login_view, signUp_view, tasks_view

urlpatterns = [
path('', index_view, name='index'),
path('login/', login_view, name='login'),
path('signup/', signUp_view, name='signUp'),

path('', index_view, name='index'),
path('login/', login_view, name='login'),
path('signup/', signUp_view, name='signUp'),
path('tasks/', tasks_view, name='tasks')
]
8 changes: 6 additions & 2 deletions Main/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.shortcuts import render
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from .models import Tasks

# Create your views here.

Expand All @@ -10,7 +11,10 @@ def index_view(request):

def signUp_view(request):
return HttpResponse(405)


def login_view(request):
return HttpResponse(405)

def tasks_view(request):
return render(request, 'tasks.html', {'task': Tasks.objects.all})
Binary file removed venv/bin/__pycache__/django-admin.cpython-37.pyc
Binary file not shown.
76 changes: 0 additions & 76 deletions venv/bin/activate

This file was deleted.

37 changes: 0 additions & 37 deletions venv/bin/activate.csh

This file was deleted.

75 changes: 0 additions & 75 deletions venv/bin/activate.fish

This file was deleted.

10 changes: 0 additions & 10 deletions venv/bin/django-admin

This file was deleted.

5 changes: 0 additions & 5 deletions venv/bin/django-admin.py

This file was deleted.

12 changes: 0 additions & 12 deletions venv/bin/easy_install

This file was deleted.

12 changes: 0 additions & 12 deletions venv/bin/easy_install-3.7

This file was deleted.

12 changes: 0 additions & 12 deletions venv/bin/pip

This file was deleted.

12 changes: 0 additions & 12 deletions venv/bin/pip3

This file was deleted.

12 changes: 0 additions & 12 deletions venv/bin/pip3.7

This file was deleted.

Binary file removed venv/bin/python
Binary file not shown.
Binary file removed venv/bin/python3
Binary file not shown.
Binary file removed venv/bin/python3.7
Binary file not shown.
10 changes: 0 additions & 10 deletions venv/bin/sqlformat

This file was deleted.

This file was deleted.

Loading