How to use the pin.models.Comments.objects.filter function in pin

To help you get started, we’ve selected a few pin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vchakoshy / django-pin / pin / admin.py View on Github external
def delete_all_user_posts(self, request, queryset):
        for obj in queryset:
            user = obj.user
            user.is_active = False
            user.save()
            Post.objects.filter(user=obj.user).delete()
            Comments.objects.filter(user=obj.user).delete()