allow to disable listing
This commit is contained in:
parent
42050d069b
commit
25b91fb01b
6 changed files with 44 additions and 4 deletions
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 5.1.5 on 2025-03-03 10:29
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("services", "0015_cloudprovider_address_cloudprovider_email_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="cloudprovider",
|
||||
name="disable_listing",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="consultingpartner",
|
||||
name="disable_listing",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="service",
|
||||
name="disable_listing",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="serviceoffering",
|
||||
name="disable_listing",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -98,6 +98,7 @@ class CloudProvider(models.Model):
|
|||
blank=True,
|
||||
)
|
||||
is_featured = models.BooleanField(default=False)
|
||||
disable_listing = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
@ -125,6 +126,8 @@ class Service(models.Model):
|
|||
features = ProseEditorField()
|
||||
is_featured = models.BooleanField(default=False)
|
||||
is_coming_soon = models.BooleanField(default=False)
|
||||
disable_listing = models.BooleanField(default=False)
|
||||
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
|
@ -176,6 +179,8 @@ class ConsultingPartner(models.Model):
|
|||
)
|
||||
|
||||
is_featured = models.BooleanField(default=False)
|
||||
disable_listing = models.BooleanField(default=False)
|
||||
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
|
@ -207,6 +212,8 @@ class ServiceOffering(models.Model):
|
|||
null=True,
|
||||
)
|
||||
|
||||
disable_listing = models.BooleanField(default=False)
|
||||
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from hub.services.models import ServiceOffering, CloudProvider, Category, Servic
|
|||
|
||||
def offering_list(request):
|
||||
offerings = (
|
||||
ServiceOffering.objects.all()
|
||||
ServiceOffering.objects.filter(disable_listing=False)
|
||||
.order_by("service")
|
||||
.select_related("service", "cloud_provider")
|
||||
.prefetch_related(
|
||||
|
|
|
@ -5,7 +5,7 @@ from hub.services.models import ConsultingPartner, CloudProvider, Service
|
|||
|
||||
def partner_list(request):
|
||||
partners = (
|
||||
ConsultingPartner.objects.all()
|
||||
ConsultingPartner.objects.filter(disable_listing=False)
|
||||
.order_by("name")
|
||||
.prefetch_related("services", "cloud_providers")
|
||||
)
|
||||
|
|
|
@ -8,7 +8,7 @@ from hub.services.models import (
|
|||
|
||||
def provider_list(request):
|
||||
providers = (
|
||||
CloudProvider.objects.all()
|
||||
CloudProvider.objects.filter(disable_listing=False)
|
||||
.order_by("name")
|
||||
.prefetch_related("offerings", "consulting_partners")
|
||||
)
|
||||
|
|
|
@ -10,7 +10,7 @@ from hub.services.models import (
|
|||
|
||||
def service_list(request):
|
||||
services = (
|
||||
Service.objects.all()
|
||||
Service.objects.filter(disable_listing=False)
|
||||
.order_by("-is_featured", "is_coming_soon", "name")
|
||||
.prefetch_related(
|
||||
"categories",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue