New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On delete cascade #47

Closed
mapeveri opened this Issue May 28, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@mapeveri
Contributor

mapeveri commented May 28, 2016

Is posible add on_delete=models.CASCADE to model HitCount:

  @python_2_unicode_compatible
   class HitCount(models.Model):
        ...
        content_type = models.ForeignKey(
            ContentType, related_name="content_type_set_for_%(class)s", on_delete=models.CASCADE)

For remove automatic in model HitCount when occurs on delete event in model parent?.

Thanks!

@mapeveri mapeveri changed the title from On delete in cascade to On delete cascade May 28, 2016

@thornomad

This comment has been minimized.

Owner

thornomad commented May 31, 2016

Hi there -

Yes, I can add that. It looks like it will be required by version 2.0. From reading the docs, though, it seems that previous version DEFAULT to using models.CASCADE ... so, that is the behavior you should be seeing I think. Is that not the case?

Thanks for bringing it to my attention.

@thornomad thornomad self-assigned this May 31, 2016

@mapeveri

This comment has been minimized.

Contributor

mapeveri commented May 31, 2016

No, it does not work. I'll keep trying, can I have something wrong.

@thornomad

This comment has been minimized.

Owner

thornomad commented May 31, 2016

Okay - I started playing with test case and it seems to work for me; will look at more shortly.

@thornomad thornomad closed this in 6f5b1e1 May 31, 2016

@thornomad

This comment has been minimized.

Owner

thornomad commented May 31, 2016

I added the line for 2.0 and added a test case ... seems to work on my end. Good luck!

@mapeveri

This comment has been minimized.

Contributor

mapeveri commented Jun 1, 2016

Thank you so much! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment