2010/8/13 Nick Serra
> Look into the clear() method on many to many relations.
> Calling .clear() before a delete will remove all relations between the
> models and allow you to delete the category only. You might be
> fighting the django admin on this though, so this would
Look into the clear() method on many to many relations.
Calling .clear() before a delete will remove all relations between the
models and allow you to delete the category only. You might be
fighting the django admin on this though, so this would be best
implemented in a custom solution. Not sure
2010/8/13 cootetom
> Hi, as far as i'm aware, the delete method on models only get's called
> if you delete an instance of that modal directly. So if you delete a
> modal who has many children, the child delete methods don't get
> called. So I suppose the next question would
Hi, as far as i'm aware, the delete method on models only get's called
if you delete an instance of that modal directly. So if you delete a
modal who has many children, the child delete methods don't get
called. So I suppose the next question would be are you deleting
TrackCategory's directly or
Hi,
I have a m2m like this:
class TrackCategory(Model):
class Track(Model):
category = models.ManyToManyField(TrackCategory)
I want to avoid that users delete a TrackCategory which contains Tracks, the
best would be to allow deletion of the TrackCategory if and only the linked
Tracks
5 matches
Mail list logo