Registering the same model from different apps raises:
ValueError: Model is already registered: '<class 'MyModel'>'
but this should not happen, because AnyUrlField could be used by different apps and each app should be allowed to register all the models that it needs, regardless of the models registered by other apps.
Possible solutions:
-
Don't raise ValueError, just ignore the registration of a model already registered.
-
When registering a model, check from which app the model is registered and raise a ValueError only if the model has been registered more than once from the same app.
Registering the same model from different apps raises:
but this should not happen, because
AnyUrlFieldcould be used by different apps and each app should be allowed to register all the models that it needs, regardless of the models registered by other apps.Possible solutions:
Don't raise
ValueError, just ignore the registration of a model already registered.When registering a model, check from which app the model is registered and raise a
ValueErroronly if the model has been registered more than once from the same app.