Reputation: 6566
In my Django admin i want to add the URLField box dynamically.that means In my model i have one URLField for that model,In future the links will be added more than one.but i have only one URLField.I wannt it should be flexible to add multiple URLFields.
Note: Inline Model will solve this. but,For the single field it should be extended as a Foreignkey also it occupies lot of time for that optional operation.
I am expecting the custom support to add the model fields only in django admin?
The attached file will expect something!
Upvotes: 1
Views: 536
Reputation: 34553
One approach is to limit the inline formset to 0 extra objects if there is already a record present for that foreign key field by setting the "extra" property: https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#inlinemodeladmin-options
Upvotes: 1