I have a question regarding the best way to conceptualize a model. I
have a tasks model, which I want to hook to a few different other
models: The model Project, the model Company and a few other undefined
models. The problem is that I want a particular instance of the task
to be pluggable to one a
well, u can add multiple FK relations to your model e.g.:
company = models.ForeignKey(Company, blank=True, null=True)
other_model = models.ForeignKey(OtherModel, blank=True, null=True)
And then in form you just define clean method which will ensure that
one and only one FK relation will be create
On Tue, Oct 26, 2010 at 6:21 PM, pixelcowboy wrote:
> I have a question regarding the best way to conceptualize a model. I
> have a tasks model, which I want to hook to a few different other
> models: The model Project, the model Company and a few other undefined
> models. The problem is that I wa
The second solution would be great, but is the relationship inherited?
I didnt think that was possible. Will try it out, first solution is
also an option. Thanks for your help.
On Oct 27, 1:35 pm, Marc Aymerich wrote:
> On Tue, Oct 26, 2010 at 6:21 PM, pixelcowboy wrote:
>
> > I have a question r
Yes, it works! Thanks so much, that is the perfect solution!
Inheritance in Django in my opinion should do much more, but in this
case it actually does the job!
On Oct 27, 2:31 pm, pixelcowboy wrote:
> The second solution would be great, but is the relationship inherited?
> I didnt think that was
5 matches
Mail list logo