change on broker (organization type) - some changes on livestock & herd
This commit is contained in:
17
apps/product/migrations/0066_remove_broker_organization.py
Normal file
17
apps/product/migrations/0066_remove_broker_organization.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 5.0 on 2025-08-05 12:38
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0065_productstats_given_distribution_number'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='broker',
|
||||
name='organization',
|
||||
),
|
||||
]
|
||||
20
apps/product/migrations/0067_broker_organization_type.py
Normal file
20
apps/product/migrations/0067_broker_organization_type.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 5.0 on 2025-08-05 12:40
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('authentication', '0027_remove_organizationstats_total_buyers_and_more'),
|
||||
('product', '0066_remove_broker_organization'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='broker',
|
||||
name='organization_type',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='product_organization', to='authentication.organizationtype'),
|
||||
),
|
||||
]
|
||||
@@ -3,7 +3,7 @@ from simple_history.models import HistoricalRecords
|
||||
from django.db import models
|
||||
from apps.core.models import BaseModel
|
||||
from apps.authorization.models import UserRelations
|
||||
from apps.authentication.models import Organization
|
||||
from apps.authentication.models import OrganizationType, Organization
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from apps.livestock.models import LiveStockType
|
||||
from datetime import datetime
|
||||
@@ -238,8 +238,8 @@ class Broker(BaseModel):
|
||||
related_name='product_broker',
|
||||
null=True
|
||||
)
|
||||
organization = models.ForeignKey(
|
||||
Organization,
|
||||
organization_type = models.ForeignKey(
|
||||
OrganizationType,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='product_organization',
|
||||
null=True
|
||||
|
||||
Reference in New Issue
Block a user