Hello,
i'm building a simple app for Django and I'm facing some problems with my models design, and the use of 'inlines' in the administration interface.
The app is to manage projects.
A project consists of a name, a description, other fields (e.g. tags...) and of multiple urls (like project url, source code repository url) but the number is not fixed, they can have 1, 2 or more urls (i think 0 will never be the case).
I have first created simple models like:
class Url(models.Model):
name = models.CharField(max_length=100)
url = models.URLField()
class Project(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=300)
...
urls = models.ManyToManyField(Url, blank=True)
but with these models I did't manage to have an admin interface where i can had a project and add at the same time one or more urls.
I have tried to use 'inlines' in the admin website like indicated in the doc but without success.
I'm not even sure the models/database design (e.g. urls won't be reused in various projects, and the manytomanyfield let you choose between allready existing urls which may not be necessary), but I don't know what can be other solutions (lists, ...).
Can anyone help me with this (simple i think) problem?
Indicate me some useful guidelines to choose a models/db design?
Even maybe point me to some example code implementing this sort of problem, with admin interface as indicated?
Thanks for responses and don't hesitate to ask details if it's not clear enough.