Skip to content

Commit

Permalink
This commit is to deliver the model of the project'
Browse files Browse the repository at this point in the history
  • Loading branch information
“Emmanuel” committed Apr 14, 2024
1 parent 42cedb3 commit 1962172
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 3 deletions.
Binary file added db.sqlite3
Binary file not shown.
Binary file added medicines/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added medicines/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file added medicines/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file added medicines/__pycache__/models.cpython-311.pyc
Binary file not shown.
26 changes: 26 additions & 0 deletions medicines/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 5.0.4 on 2024-04-14 20:22

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
('research_facilities', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='medicine',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=70)),
('created_at', models.DateTimeField(auto_now_add=True)),
('price', models.IntegerField(default=1)),
('research_facility', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='medicines', to='research_facilities.research_facility')),
],
),
]
Binary file not shown.
Binary file not shown.
12 changes: 10 additions & 2 deletions medicines/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from django.db import models
from django.db import models
from research_facilities.models import research_facility

# Create your models here.
class medicine (models.Model):
name = models.CharField(max_length=70, null=False)
created_at = models.DateTimeField(auto_now_add=True)
price = models.IntegerField(default=1,null=False)
research_facility = models.ForeignKey(research_facility, on_delete=models.CASCADE, related_name='medicines')

def __str__(self) -> str:
return self.name
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions pharmaceutical_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'medicines', #App registration
'research_facilities'

]

MIDDLEWARE = [
Expand Down
Binary file not shown.
Binary file not shown.
Binary file added research_facilities/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file not shown.
22 changes: 22 additions & 0 deletions research_facilities/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 5.0.4 on 2024-04-14 20:15

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='research_facility',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=70)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
),
]
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion research_facilities/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.db import models

class ResearchFacility (models.Model):
class research_facility (models.Model):
name = models.CharField(max_length=70, null=False)
created_at = models.DateTimeField(auto_now_add=True)

Expand Down

0 comments on commit 1962172

Please sign in to comment.