@@ -445,8 +445,6 @@ def get_model(
445
445
Generates a temporary Django model based on available fields that belong to
446
446
this table. Returns cached model if available, otherwise generates and caches it.
447
447
448
- :param fields: Extra table field instances that need to be added the model.
449
- :type fields: list
450
448
:param skip_object_fields: Don't add object or multiobject fields to the model
451
449
:type skip_object_fields: bool
452
450
:return: The generated model.
@@ -527,16 +525,6 @@ def wrapped_post_through_setup(self, cls):
527
525
del apps .all_models [APP_LABEL ][model_name .lower ()]
528
526
529
527
apps .register_model (APP_LABEL , model )
530
- '''
531
- try:
532
- existing_model = apps.get_model(APP_LABEL, model_name)
533
- # If model exists but is different, we have a problem
534
- if existing_model is not model:
535
- # Use the existing model to avoid conflicts
536
- model = existing_model
537
- except LookupError:
538
- apps.register_model(APP_LABEL, model)
539
- '''
540
528
541
529
self ._after_model_generation (attrs , model )
542
530
@@ -548,13 +536,6 @@ def wrapped_post_through_setup(self, cls):
548
536
apps .clear_cache ()
549
537
ContentType .objects .clear_cache ()
550
538
551
- '''
552
- # Register the serializer for this model
553
- from netbox_custom_objects.api.serializers import get_serializer_class
554
-
555
- get_serializer_class(model)
556
- '''
557
-
558
539
# Register the global SearchIndex for this model
559
540
self .register_custom_object_search_index (model )
560
541
0 commit comments