Here is my situation:

1. I have a model "Client", with a boolean attribute "service_1"
2. I also have a model "Service_1_Profile"
3. When "Client.service_1" is set to on, I want a corresponding
"Service_1_Profile" to be created.
4. When "Client.service_1" is set to off, I want the corresponding
"Service_1_Profile" to be dropped.
5. Setting the "service_1" attribute on and off only occurs in the
Admin interface, not in a public interface
6. I am using the SVN release with MySQL backend

In my warped brain, my models should look something like this and know
exactly what they are supposed to do:

class Client (models.Model):
    client_name = models.CharField ()
    service_1 = models.BooleanField ()

class Service_1_Profile (models.Model):
    client = models.OneToOneField (Client, limit_choices_to =
{'service_1': 1})
    some_attribute = models.CharField ()

Obviously this is flawed, and I am hesitant to use the OneToOne since
the documentation states, "The semantics of one-to-one relationships
will be changing soon, so we don't recommend you use them."

I currently have "Service_1_Profile.client" set as a foreign key to
"Client", and I am creating the profiles manually. Any suggestions on
how to automate this in accordance with steps 1-5?


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

Reply via email to