django-4.1

Django: Filter matching objects using 2 fields

Django: Filter matching objects using 2 fields Question: I have the following classes: class Event(Model): … class IOCType(Model): name = CharField(max_length=50) class IOCInfo(Model): event = ForeignKey(Event, on_delete=CASCADE, related_name="iocs" ioc_type = ForeignKey(IOCType, on_delete=CASCADE) value = CharField(max_lenght=50) Each event has one or several IOCs associated with it, which are stored in the IOCInfo table. This is how …

Total answers: 3