From 77bb9ea690be6bd1226f44b4c98069308dfd252c Mon Sep 17 00:00:00 2001 From: = Date: Sat, 7 Sep 2024 07:47:37 -0400 Subject: [PATCH] first commmit --- .gitignore | 138 ++++++++++++++++++++++++++++ README.md | 60 ++++++++++++ __init__.py | 0 asgi.py | 16 ++++ settings.py | 135 +++++++++++++++++++++++++++ task_card/__init__.py | 0 task_card/admin.py | 3 + task_card/apps.py | 6 ++ task_card/models.py | 26 ++++++ task_card/tests.py | 3 + task_card/urls.py | 22 +++++ task_card/views.py | 4 + urls.py | 28 ++++++ wbsboard/__init__.py | 0 wbsboard/admin.py | 3 + wbsboard/apps.py | 6 ++ wbsboard/migrations/0001_initial.py | 41 +++++++++ wbsboard/migrations/__init__.py | 0 wbsboard/models.py | 16 ++++ wbsboard/templates/canvasboard.html | 94 +++++++++++++++++++ wbsboard/templates/wbsboard.html | 28 ++++++ wbsboard/tests.py | 3 + wbsboard/urls.py | 30 ++++++ wbsboard/views.py | 21 +++++ wsgi.py | 16 ++++ 25 files changed, 699 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 __init__.py create mode 100644 asgi.py create mode 100644 settings.py create mode 100644 task_card/__init__.py create mode 100644 task_card/admin.py create mode 100644 task_card/apps.py create mode 100644 task_card/models.py create mode 100644 task_card/tests.py create mode 100644 task_card/urls.py create mode 100644 task_card/views.py create mode 100644 urls.py create mode 100644 wbsboard/__init__.py create mode 100644 wbsboard/admin.py create mode 100644 wbsboard/apps.py create mode 100644 wbsboard/migrations/0001_initial.py create mode 100644 wbsboard/migrations/__init__.py create mode 100644 wbsboard/models.py create mode 100644 wbsboard/templates/canvasboard.html create mode 100644 wbsboard/templates/wbsboard.html create mode 100644 wbsboard/tests.py create mode 100644 wbsboard/urls.py create mode 100644 wbsboard/views.py create mode 100644 wsgi.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1cf0110 --- /dev/null +++ b/.gitignore @@ -0,0 +1,138 @@ +# Django # +*.log +*.pot +*.pyc +__pycache__ +db.sqlite3 +media + +# Backup files # +*.bak + +# If you are using PyCharm # +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# File-based project format +*.iws + +# IntelliJ +out/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Python # +*.py[cod] +*$py.class + +# Distribution / packaging +.Python build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.whl +*.egg-info/ +.installed.cfg +*.egg +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +.pytest_cache/ +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery +celerybeat-schedule.* + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# Sublime Text # +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache +*.sublime-workspace +*.sublime-project + +# sftp configuration file +sftp-config.json + +# Package control specific files Package +Control.last-run +Control.ca-list +Control.ca-bundle +Control.system-ca-bundle +GitHub.sublime-settings + +# Visual Studio Code # +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f7412a5 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +1. Start Program + -Authentication screen + -User authenticates + -(system) gives authorization to different capabilities of the program based on role) +2. Display Welcome Message and Options Menu + - Option 1: Create New Project + - Define project + - Define\add-existing roles in addition to project initiator role if admin (not shown if not) + - Assign project manager(s) user(s) if PMO admin + - (system) if not admin create a signal for PMO Admins task card for assignment of a project manager + - Option 2: Load Existing Project if authorized + - Request access to an existing project + - (system) create a signal for project manager(s) request access task card + - Option 3: Exit Program +3. If Option 1 selected: + 3.1. Prompt user to choose project methodology template + - If "PMO Admin" show button for project methodology web application + - Display list of available templates + - User selects a template + 3.2. Create new project based on selected template + - Initialize project with cards representing tasks from the template + - Display project dashboard + - Allow user to perform actions on project (e.g., add, edit, delete tasks) +4. If Option 2 selected: + 4.1. Prompt user to load existing project file + - User provides file path + - Load project from file + 4.2. Display project dashboard + - Allow user to perform actions on project (e.g., add, edit, delete tasks) +5. Project Dashboard Options: + - Option A: View Project Overview (summary of tasks, progress, etc.) + - Option B: Manage Cards in infinite self-organizing canvas as frontend (react) + - Option B1: Add New Card (api to backend) + - Option B2: Edit Card (modify details, update status, etc. - api to backend) + - Option B3: Delete Card (api to backend) + - Option B4: Split Card into Subtasks (api to backend) + - Option B5: Change Card relations (api to backend) + - Option C: Import Cards from Another Project + - User selects project file to import cards from ( then turn it to a list of cards to be created through api to backend) + - Merge imported cards into current project ( execute insert cards through api to backend) + - Option D: Export Cards to Another Project + - User selects project file to export cards to + - Export selected cards to specified project file + - Option E: Save Project + - Save current project state to file + - Option F: Exit to Main Menu +6. Repeat steps 3-5 until user chooses to exit the program +7. Display Farewell Message +8. End Program + +Existing Roles +"Application Admin" - Install and configuration of the application +"Application Designer" - Application customization +"Database Admin" - Links and manages backend databases\schemas +"PMO Admin" - Policy and methodology management +"Program Manager" - Business value reporting and projects monitoring +"Project Manager" - Budget, scope, communication, control, reporting management +"Project Coordinator" - Resource and task management +"Project User" - Task management +"Project initiator" - Most basic role that creates a project, defines business value statement, provides high level scope, provides high level budget, provides expected start and end dates for the project. \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/asgi.py b/asgi.py new file mode 100644 index 0000000..ef1aa8d --- /dev/null +++ b/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for p00001 project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'p00001.settings') + +application = get_asgi_application() diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..1d1adf0 --- /dev/null +++ b/settings.py @@ -0,0 +1,135 @@ +""" +Django settings for p00001 project. + +Generated by 'django-admin startproject' using Django 5.0.4. + +For more information on this file, see +https://docs.djangoproject.com/en/5.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.0/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-ipo62&72a-0)=d^4t)@#%1e815i(h89q$@d__p+*#d-ntx*u5p' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'p00001.wbsboard', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'p00001.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'p00001.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.0/ref/settings/#databases + +#DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.sqlite3', +# 'NAME': BASE_DIR / 'db.sqlite3', +# } +#} + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'p00001', + 'USER': 'p00001user', + 'PASSWORD': 'ExpressDelivery.123', + 'HOST': 'localhost', + 'PORT': '5432', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/5.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/task_card/__init__.py b/task_card/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/task_card/admin.py b/task_card/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/task_card/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/task_card/apps.py b/task_card/apps.py new file mode 100644 index 0000000..67ec0bd --- /dev/null +++ b/task_card/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class TaskCardConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'task_card' diff --git a/task_card/models.py b/task_card/models.py new file mode 100644 index 0000000..197f3d7 --- /dev/null +++ b/task_card/models.py @@ -0,0 +1,26 @@ +from django.db import models + + +class Task_Id(models.Model): + taskId = models.AutoField(primary_key=True, unique=True) + +class Task_Name(models.Model): + name = models.CharField(max_length=100) + +class Task_Start_Date(models.Model): + taskStartDate = models.DateField(auto_now=False, auto_now_add=False, attributes) + +class Task_End_Date(models.Model): + taskStartDate = models.DateField(auto_now=False, auto_now_add=False, attributes) + +class Task_Status(models.Model): + CHOICES = [ + ('choice1', 'initiated'), + ('choice2', 'started'), + ('choice3', 'stalled'), + ('choice4', 'parked'), + ('choice5', 'abandonned'), + ('choice6', 'completed'), + ] + + selected_word = models.CharField(max_length=50, choices=CHOICES) \ No newline at end of file diff --git a/task_card/tests.py b/task_card/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/task_card/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/task_card/urls.py b/task_card/urls.py new file mode 100644 index 0000000..a0cd4c4 --- /dev/null +++ b/task_card/urls.py @@ -0,0 +1,22 @@ +""" +URL configuration for p00001 project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.urls import path +from . import views + +urlpatterns = [ + path("", views.index, name="index"), +] diff --git a/task_card/views.py b/task_card/views.py new file mode 100644 index 0000000..7207a5d --- /dev/null +++ b/task_card/views.py @@ -0,0 +1,4 @@ +from django.http import HttpResponse +# Create your views here. +def index(request): + return HttpResponse("You are at task card module") \ No newline at end of file diff --git a/urls.py b/urls.py new file mode 100644 index 0000000..8f9d208 --- /dev/null +++ b/urls.py @@ -0,0 +1,28 @@ +""" +URL configuration for p00001 project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import include, path + + +urlpatterns = [ + path( '', include('p00001.wbsboard.urls')), + path('wbsboard/', include('p00001.wbsboard.urls')), + path('task_card/', include('p00001.task_card.urls')), + path('admin/', admin.site.urls), +] + + diff --git a/wbsboard/__init__.py b/wbsboard/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/wbsboard/admin.py b/wbsboard/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/wbsboard/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/wbsboard/apps.py b/wbsboard/apps.py new file mode 100644 index 0000000..4192e1d --- /dev/null +++ b/wbsboard/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class WbsboardConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'p00001.wbsboard' diff --git a/wbsboard/migrations/0001_initial.py b/wbsboard/migrations/0001_initial.py new file mode 100644 index 0000000..b9c25f4 --- /dev/null +++ b/wbsboard/migrations/0001_initial.py @@ -0,0 +1,41 @@ +# Generated by Django 5.0.4 on 2024-05-02 09:14 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='WBSBoard', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ], + ), + migrations.CreateModel( + name='Task_List', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=100)), + ('order', models.IntegerField(default=0)), + ('wbsboard', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_lists', to='wbsboard.wbsboard')), + ], + ), + migrations.CreateModel( + name='Task_Card', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=100)), + ('description', models.TextField(blank=True)), + ('order', models.IntegerField(default=0)), + ('task_list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_cards', to='wbsboard.wbsboard')), + ], + ), + ] diff --git a/wbsboard/migrations/__init__.py b/wbsboard/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/wbsboard/models.py b/wbsboard/models.py new file mode 100644 index 0000000..4bbd3a1 --- /dev/null +++ b/wbsboard/models.py @@ -0,0 +1,16 @@ +from django.db import models + +class WBSBoard(models.Model): + name = models.CharField(max_length=100) + +class Task_List(models.Model): + wbsboard = models.ForeignKey(WBSBoard, related_name='task_lists', on_delete=models.CASCADE) + title = models.CharField(max_length=100) + order = models.IntegerField(default=0) + +class Task_Card(models.Model): + task_list = models.ForeignKey(WBSBoard, related_name='task_cards', on_delete=models.CASCADE) + title = models.CharField(max_length=100) + description = models.TextField(blank=True) + order = models.IntegerField(default=0) + diff --git a/wbsboard/templates/canvasboard.html b/wbsboard/templates/canvasboard.html new file mode 100644 index 0000000..5a26320 --- /dev/null +++ b/wbsboard/templates/canvasboard.html @@ -0,0 +1,94 @@ + + + + + +Infinite Canvas with Cards + + + + + + + diff --git a/wbsboard/templates/wbsboard.html b/wbsboard/templates/wbsboard.html new file mode 100644 index 0000000..24139fa --- /dev/null +++ b/wbsboard/templates/wbsboard.html @@ -0,0 +1,28 @@ +! + + + WBSBoard + + + +
+ {% for wbsboard in wbsboards %} +
+

{{ wbsboard.name }}

+
+ {% for lst in wbsboard.task_lists.all %} +
+

{{ lst.title }}

+
    + {% for task_card in lst.cards.all %} +
  • {{ task_card.title }}
  • + {% endfor %} +
+
+ {% endfor %} +
+
+ {% endfor %} +
+ + \ No newline at end of file diff --git a/wbsboard/tests.py b/wbsboard/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/wbsboard/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/wbsboard/urls.py b/wbsboard/urls.py new file mode 100644 index 0000000..64b0d17 --- /dev/null +++ b/wbsboard/urls.py @@ -0,0 +1,30 @@ +""" +URL configuration for p00001 project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.urls import path +from . import views + +urlpatterns = [ + path("", views.index, name="index"), +] + +from django.urls import path +from .views import task_card_list + +urlpatterns = [ + path('task-cards/', task_card_list, name='task_card_list'), + # Other URL patterns +] \ No newline at end of file diff --git a/wbsboard/views.py b/wbsboard/views.py new file mode 100644 index 0000000..539d72e --- /dev/null +++ b/wbsboard/views.py @@ -0,0 +1,21 @@ +from django.shortcuts import render +from .models import WBSBoard +from django.http import HttpResponse +from django.template import loader +from models importg task_card + +def index(request): + template = loader.get_template('canvasboard.html') + return HttpResponse(template.render()) + + +def wbsboard(request): + wbsboard = WBSBoard.objects.all() + return render(request, 'wbsboard/wbsboard.html', {'wbsboard': wbsboard}) + + +from django.shortcuts import render +from .models import TaskCard + + + diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..d6131d7 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for p00001 project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'p00001.settings') + +application = get_wsgi_application()