Is it feasible to establish an alias for a model on Django Admin Pages? For instance, if the admin page is accessible via the URL route “admin/” and there’s an app named “products” with a database table named “batch,” the default URL route generated by Django for the change list view would be “admin/products/batch.” Is there a way to create an alias for this model?
In other words, could “admin/products/batch” and “admin/products/lim” both be configured to reference the same database table? Navigating to either of these URLs would then lead to the batch change list view. Is such a capability supported in Django, allowing the creation of alias names for URL routes that point to the same model? I’ve been unable to find any examples of such aliases online.
models.py
class Batch(models.Model):
# fields here …class Meta: verbose_name = 'Batch' verbose_name_plural = 'Batch'
admin.py
class BatchAdmin(admin.ModelAdmin):
fieldsets = [(‘Details’, {‘fields’ : […]})]
list_display = […]admin.site.register(Batch, BatchAdmin)
I have retracted most of the code from the model and modelAdmin, but that should give a rough idea.