remove wagtail and admin website, remove edit option, from hitung ayam, add create flock to settings

This commit is contained in:
Alberto-Audrix committed 2026-08-31 16:00:44 +07:00
1 parent 74dd3faf60
commit 30a736641f
39 files changed
+634 -819

No files matched your search

+2 -3
View File
@@ -19,7 +19,7 @@ class CycleContextMixin(serializers.Serializer):
flock_id = serializers.SerializerMethodField()
def get_flock_id(self, obj):
flock = obj.cycle.flocks.order_by("flock_id").first()
flock = obj.cycle.kandang.flocks.order_by("flock_id").first()
return flock.pk if flock is not None else None
@@ -124,8 +124,7 @@ class IotPanelSerializer(PkAsIdMixin, serializers.ModelSerializer):
read_only_fields = ["id", "created_at", "updated_at"]
def get_kandang(self, obj):
cycle = getattr(obj.flock, "cycle", None)
return cycle.kandang_id if cycle is not None else None
return obj.flock.kandang_id
class AIInsightSerializer(PkAsIdMixin, CycleContextMixin, serializers.ModelSerializer):