diff --git a/assets/pasted-20251123-151520-06b3bb4c.png b/assets/pasted-20251123-151520-06b3bb4c.png new file mode 100644 index 0000000..3823046 Binary files /dev/null and b/assets/pasted-20251123-151520-06b3bb4c.png differ diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc index f8814a7..a98d759 100644 Binary files a/core/__pycache__/forms.cpython-311.pyc and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index a1c59e5..d1d5cef 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index c3c9e1e..da1d71b 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/forms.py b/core/forms.py index 01d237e..ef7cd2a 100644 --- a/core/forms.py +++ b/core/forms.py @@ -4,7 +4,7 @@ from .models import TodoItem class TodoItemForm(forms.ModelForm): class Meta: model = TodoItem - fields = ['title', 'description', 'tags', 'status'] + fields = ['title', 'description', 'tags', 'status', 'deadline'] widgets = { 'title': forms.TextInput(attrs={ 'class': 'form-control', @@ -21,5 +21,9 @@ class TodoItemForm(forms.ModelForm): }), 'status': forms.Select(attrs={ 'class': 'form-control' + }), + 'deadline': forms.DateInput(attrs={ + 'class': 'form-control', + 'type': 'date' }) } \ No newline at end of file diff --git a/core/migrations/0008_todoitem_deadline.py b/core/migrations/0008_todoitem_deadline.py new file mode 100644 index 0000000..559b2f3 --- /dev/null +++ b/core/migrations/0008_todoitem_deadline.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.7 on 2025-11-23 15:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0007_conversation_is_generating'), + ] + + operations = [ + migrations.AddField( + model_name='todoitem', + name='deadline', + field=models.DateField(blank=True, null=True), + ), + ] diff --git a/core/migrations/__pycache__/0008_todoitem_deadline.cpython-311.pyc b/core/migrations/__pycache__/0008_todoitem_deadline.cpython-311.pyc new file mode 100644 index 0000000..2fef7fa Binary files /dev/null and b/core/migrations/__pycache__/0008_todoitem_deadline.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 51ac0a9..6c9ef49 100644 --- a/core/models.py +++ b/core/models.py @@ -18,6 +18,7 @@ class TodoItem(models.Model): title = models.CharField(max_length=200) description = models.TextField(blank=True, null=True) tags = models.CharField(max_length=255, blank=True, null=True) + deadline = models.DateField(blank=True, null=True) status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='todo') created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 4dd0437..9c740e5 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -28,6 +28,10 @@ {{ form.tags.label_tag }} {{ form.tags }} +
+ {{ form.deadline.label_tag }} + {{ form.deadline }} +
{{ form.status.label_tag }} {{ form.status }} @@ -54,6 +58,7 @@ Tags Status Created + Deadline Actions @@ -71,6 +76,7 @@ {{ item.get_status_display }} {{ item.created_at|date:"M d, Y" }} + {{ item.deadline|date:"M d, Y"|default:"" }}
{% csrf_token %} diff --git a/core/templates/core/kanban.html b/core/templates/core/kanban.html index a8faacb..0a2f3af 100644 --- a/core/templates/core/kanban.html +++ b/core/templates/core/kanban.html @@ -38,6 +38,9 @@ {% endfor %}
{% endif %} + {% if item.deadline %} +

Deadline: {{ item.deadline|date:"Y-m-d" }}

+ {% endif %} {% endfor %} diff --git a/core/views.py b/core/views.py index dcd9a32..73873b2 100644 --- a/core/views.py +++ b/core/views.py @@ -113,10 +113,11 @@ def execute_command(command_data): title=title, description=args.get('description', ''), status=args.get('status', 'todo'), - tags=args.get('tags', '') + tags=args.get('tags', ''), + deadline=args.get('deadline') ) logger.info(f"Command 'add_task' executed successfully. New task ID: {new_task.id}") - return f"[SYSTEM] Command 'add_task' executed successfully. A new task with ID {new_task.id}, title '{new_task.title}', description '{new_task.description}', status '{new_task.status}', and tags '{new_task.tags}' has been created." + return f"[SYSTEM] Command 'add_task' executed successfully. A new task with ID {new_task.id}, title '{new_task.title}', description '{new_task.description}', status '{new_task.status}', tags '{new_task.tags}', and deadline '{new_task.deadline}' has been created." elif command_name == 'edit_task': task_id = args.get('task_id') @@ -134,10 +135,12 @@ def execute_command(command_data): task.status = args['status'] if 'tags' in args: task.tags = args['tags'] + if 'deadline' in args: + task.deadline = args['deadline'] task.save() logger.info(f"Command 'edit_task' for task ID {task_id} executed successfully.") - return f"[SYSTEM] Command 'edit_task' for task ID {task_id} executed successfully. The task now has title '{task.title}', description '{task.description}', status '{task.status}', and tags '{task.tags}'." + return f"[SYSTEM] Command 'edit_task' for task ID {task_id} executed successfully. The task now has title '{task.title}', description '{task.description}', status '{task.status}', tags '{task.tags}', and deadline '{task.deadline}'." elif command_name == 'delete_task': task_id = args.get('task_id') @@ -179,7 +182,7 @@ def run_ai_process_in_background(conversation_id): key='custom_instructions', defaults={'value': ''} ) - custom_instructions_text = custom_instructions.value + '\n\n' if custom_instructions.value else '' + custom_instructions_text = custom_instructions.value + '''\n\n''' if custom_instructions.value else '' system_message = { "role": "system", @@ -210,6 +213,7 @@ def run_ai_process_in_background(conversation_id): * `description` (string, optional): A detailed description of the task. * `status` (string, optional, default: 'todo'): The status of the task. Valid options are 'todo', 'inprogress', 'done', 'blocked'. * `tags` (string, optional): A comma-separated string of tags (e.g., "work,urgent"). + * `deadline` (string, optional): The deadline for the task in YYYY-MM-DD format. * `edit_task`: Edits an existing task. * `args`: * `task_id` (integer, required): The ID of the task to edit. @@ -217,6 +221,7 @@ def run_ai_process_in_background(conversation_id): * `description` (string, optional): The new description. * `status` (string, optional): The new status. Valid options are 'todo', 'inprogress', 'done', 'blocked'. * `tags` (string, optional): The new comma-separated string of tags. + * `deadline` (string, optional): The new deadline for the task in YYYY-MM-DD format. * `delete_task`: Deletes a task. * `args`: * `task_id` (integer, required): The ID of the task to delete. @@ -266,7 +271,8 @@ def run_ai_process_in_background(conversation_id): tasks = TodoItem.objects.all().order_by('created_at') task_list = [] for task in tasks: - task_list.append(f"- ID {task.id}: {task.title} (Status: {task.get_status_display()}, Tags: {task.tags or 'None'})") + deadline_str = f", Deadline: {task.deadline}" if task.deadline else "" + task_list.append(f"- ID {task.id}: {task.title} (Status: {task.get_status_display()}, Tags: {task.tags or 'None'}{deadline_str})") task_list_str = "\n".join(task_list) tasks_context = { @@ -419,4 +425,4 @@ def settings_view(request): def delete_conversation(request, conversation_id): conversation = get_object_or_404(Conversation, id=conversation_id) conversation.delete() - return redirect('core:chat') \ No newline at end of file + return redirect('core:chat')