mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-18 19:32:24 -06:00
17929 Add Scope Mixins to Prefix (#17930)
* 17929 Add Scope Mixins to Prefix * 17929 Add Scope Mixins to Prefix * 17929 fixes for tests * 17929 merge latest scope changes * 12596 review changes * 12596 review changes * 12596 review changes * 12596 review changes * 12596 review changes * 12596 review changes * 17929 fix migrations
This commit is contained in:
@@ -129,7 +129,7 @@ def get_annotations_for_serializer(serializer_class, fields_to_include=None):
|
||||
|
||||
for field_name, field in serializer_class._declared_fields.items():
|
||||
if field_name in fields_to_include and type(field) is RelatedObjectCountField:
|
||||
related_field = model._meta.get_field(field.relation).field
|
||||
related_field = getattr(model, field.relation).field
|
||||
annotations[field_name] = count_related(related_field.model, related_field.name)
|
||||
|
||||
return annotations
|
||||
|
||||
Reference in New Issue
Block a user