Skip to content

Commit

Permalink
Database model
Browse files Browse the repository at this point in the history
  • Loading branch information
berk76 committed Mar 8, 2024
1 parent d25a024 commit 67b72ed
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Generated by Django 5.0.2 on 2024-03-08 18:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('articles', '0002_alter_article_options_alter_articlecomment_options_and_more'),
]

operations = [
migrations.CreateModel(
name='ApplicationSetup',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('key', models.CharField(max_length=50, verbose_name='Key')),
('value', models.CharField(max_length=1000, verbose_name='Value')),
],
),
migrations.CreateModel(
name='Buliding',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('address', models.CharField(max_length=50, verbose_name='Address')),
('city', models.CharField(max_length=50, verbose_name='City')),
('post_code', models.CharField(max_length=10, verbose_name='Post code')),
('registration_no', models.CharField(max_length=50, verbose_name='Registration no.')),
],
),
migrations.CreateModel(
name='Company',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50, verbose_name='Name')),
('address', models.CharField(max_length=50, verbose_name='Address')),
('city', models.CharField(max_length=50, verbose_name='City')),
('post_code', models.CharField(max_length=10, verbose_name='Post code')),
('phone', models.CharField(max_length=30, verbose_name='Phone')),
('email', models.CharField(max_length=50, verbose_name='E-Mail')),
('registration_no', models.CharField(max_length=20, verbose_name='Registration no.')),
('vat_registration_no', models.CharField(max_length=20, verbose_name='VAT Registration no.')),
('internet_domain', models.CharField(max_length=50, verbose_name='VAT Registration no.')),
],
),
migrations.CreateModel(
name='MessageQueue',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('email', models.CharField(max_length=50, verbose_name='E-Mail')),
('subject', models.CharField(max_length=100, verbose_name='Subject')),
('body', models.TextField(verbose_name='Body')),
('creation_time', models.DateTimeField(auto_now_add=True)),
('sending_time', models.DateTimeField(null=True)),
('status', models.SmallIntegerField()),
],
),
]
36 changes: 36 additions & 0 deletions svjis/articles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,39 @@ class Meta:
("svjis_edit_admin_groups", "Can edit Groups"),
("svjis_view_personal_menu", "Can view Personal settings menu"),
)


class MessageQueue(models.Model):
email = models.CharField(_("E-Mail"), max_length=50, blank=False)
subject = models.CharField(_("Subject"),max_length=100, blank=False)
body = models.TextField(_("Body"))
creation_time = models.DateTimeField(auto_now_add=True)
sending_time = models.DateTimeField(null=True)
status = models.SmallIntegerField(null=False)

def __str__(self):
return f"MessageQueue: {self.email} - {self.subject}"


class ApplicationSetup(models.Model):
key = models.CharField(_("Key"), max_length=50, blank=False, null=False)
value = models.CharField(_("Value"), max_length=1000, null=False)


class Company(models.Model):
name = models.CharField(_("Name"), max_length=50)
address = models.CharField(_("Address"), max_length=50)
city = models.CharField(_("City"), max_length=50)
post_code = models.CharField(_("Post code"), max_length=10)
phone = models.CharField(_("Phone"), max_length=30)
email = models.CharField(_("E-Mail"), max_length=50)
registration_no = models.CharField(_("Registration no."), max_length=20)
vat_registration_no = models.CharField(_("VAT Registration no."), max_length=20)
internet_domain = models.CharField(_("VAT Registration no."), max_length=50)


class Buliding(models.Model):
address = models.CharField(_("Address"), max_length=50)
city = models.CharField(_("City"), max_length=50)
post_code = models.CharField(_("Post code"), max_length=10)
registration_no = models.CharField(_("Registration no."), max_length=50)

0 comments on commit 67b72ed

Please sign in to comment.