I’m pretty new to relational databases and this may be why I’m having this problem but I have a model – Post.
I want it to have variable number of URLs, however Django only seems to have the OneToManyField which requires a model (not a field – which URLField is).
In relational database design, the fields in a table are always scalar values. in your case, such a field would ‘a url’. The way you get a collection to apply to a row, you join that row with the rows of another table. In django parlance, that would mean that you need two models, one for the
Postobjects, and another that links multiple urls with that post.Now you can access urls through a
urlsmemberBut if you want to get the admin page for Post to also let you add urls, you need to do some tricks with InlineModelAdmin.