diff --git a/osinaweb/addressbook/__pycache__/models.cpython-313.pyc b/osinaweb/addressbook/__pycache__/models.cpython-313.pyc index 795a11ca..f016bc4e 100644 Binary files a/osinaweb/addressbook/__pycache__/models.cpython-313.pyc and b/osinaweb/addressbook/__pycache__/models.cpython-313.pyc differ diff --git a/osinaweb/addressbook/migrations/0006_comment_prospectinglist_prospectinglistitem.py b/osinaweb/addressbook/migrations/0006_comment_prospectinglist_prospectinglistitem.py new file mode 100644 index 00000000..ece95dde --- /dev/null +++ b/osinaweb/addressbook/migrations/0006_comment_prospectinglist_prospectinglistitem.py @@ -0,0 +1,45 @@ +# Generated by Django 5.1.7 on 2025-04-09 12:47 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('addressbook', '0005_socialmedia_addressbook'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Comment', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('content', models.TextField()), + ('date_added', models.DateTimeField(auto_now_add=True)), + ('added_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='ProspectingList', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ('description', models.TextField(blank=True, null=True)), + ('date_added', models.DateTimeField(auto_now_add=True)), + ('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='ProspectingListItem', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date_added', models.DateTimeField(auto_now_add=True)), + ('attention', models.BooleanField(default=False)), + ('addressbook', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='addressbook.addressbook')), + ('prospecting_list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='addressbook.prospectinglist')), + ], + ), + ] diff --git a/osinaweb/addressbook/migrations/__pycache__/0006_comment_prospectinglist_prospectinglistitem.cpython-313.pyc b/osinaweb/addressbook/migrations/__pycache__/0006_comment_prospectinglist_prospectinglistitem.cpython-313.pyc new file mode 100644 index 00000000..1a75d91b Binary files /dev/null and b/osinaweb/addressbook/migrations/__pycache__/0006_comment_prospectinglist_prospectinglistitem.cpython-313.pyc differ diff --git a/osinaweb/addressbook/models.py b/osinaweb/addressbook/models.py index e31a6052..98767c20 100644 --- a/osinaweb/addressbook/models.py +++ b/osinaweb/addressbook/models.py @@ -1,5 +1,5 @@ from django.db import models - +from osinacore.models import * # Create your models here. @@ -13,6 +13,13 @@ class Country(models.Model): name = models.CharField(max_length=100) code = models.CharField(max_length=5) + +class ProspectingList(models.Model): + name = models.CharField(max_length=100) + description = models.TextField(null=True, blank=True) + date_added = models.DateTimeField(auto_now_add=True) + added_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) + class AddressBook(models.Model): first_name = models.CharField(max_length=100) middle_name = models.CharField(max_length=100, blank=True, null=True) @@ -21,6 +28,13 @@ class AddressBook(models.Model): group = models.ManyToManyField(Group, blank=True) +class ProspectingListItem(models.Model): + prospecting_list = models.ForeignKey(ProspectingList, on_delete=models.CASCADE) + addressbook = models.ForeignKey(AddressBook, on_delete=models.CASCADE) + date_added = models.DateTimeField(auto_now_add=True) + attention = models.BooleanField(default=False) + + class Contact(models.Model): TYPE_CHOICES = ( ('Email', 'Email'), @@ -47,3 +61,8 @@ class SocialMedia(models.Model): link = models.URLField(blank=True) addressbook = models.ForeignKey(AddressBook, on_delete=models.CASCADE, null=True) + +class Comment(models.Model): + content = models.TextField() + date_added = models.DateTimeField(auto_now_add=True) + added_by = models.ForeignKey(User, on_delete=models.CASCADE) diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 63641231..e7bf539e 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ