Hi all,

I'm trying to build a web application to keep track of my firewall
requests.
I want to keep track of hosts and hostgroups, but I got stuck in
creating the model. The problem is the following:

I have 3 tables:

Host
------
id (Primary key)
name
ipaddress
netmask
creation_date

Hostgroup
-----------
id (primary key)
name
creation_date

HostgroupMembers
-----------------
id (foreign key to Hostgroup.id)
host_id (foreign key to Host.id)
hostgroup_id (???)

Now, a hostgroup contains one or more hosts, but it can also contain one
or more hostgroups.
For each hostgroup, I have inlines where I can add host(groups) to a hostgroup.
Somehow, I have to create a second foreign key in the HostgroupMembers
table to the Hostgroup table, but I think that's not the way.
If possible, I would like to have the hosts and hostgroups in the same dropdown 
box
on the admin portal.

I hope I made myself clear. FYI, I use sqlite3 for development, but I'm
going to use Postgresql in production.

Does anyone know how to do this in Django?
I don't prefer writing custom SQL.


-- 
 Wim

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to