# Path: happenings/signals.py
# def update_time(sender, **kwargs):
#     """
#     When a Comment is added, updates the Update to set "last_updated" time
#     """
#     comment = kwargs['instance']
#     if comment.content_type.app_label == "happenings" and comment.content_type.name == "Update":
#         from .models import Update
#         item = Update.objects.get(id=comment.object_pk)
#         item.save()


import datetime
import os
import zipfile
from io import BytesIO
from itertools import chain
from PIL import Image as PIL_Image
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
from django.db.models import signals, Q
from django.urls import reverse
from django.utils.functional import cached_property
from tango_shared.models import ContentImage, BaseUserContentModel, BaseSidebarContentModel
from tango_shared.utils.maptools import get_geocode
from tango_shared.utils.sanetize import sanetize_text
from .signals import update_time
    from tango_comments.models import Comment



#from tango_comments.models import Comment



supports_comments = False
if 'comments' in settings.INSTALLED_APPS:
    supports_comments = True



# Path: happenings/signals.py
# def update_time(sender, **kwargs):
#     """
#     When a Comment is added, updates the Update to set "last_updated" time
#     """
#     comment = kwargs['instance']
#     if comment.content_type.app_label == "happenings" and comment.content_type.name == "Update":
#         from .models import Update
#         item = Update.objects.get(id=comment.object_pk)
#         item.save()


# Path: happenings/models.py
import datetime
import os
import zipfile
from io import BytesIO
from itertools import chain
from PIL import Image as PIL_Image
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
from django.db.models import signals, Q
from django.urls import reverse
from django.utils.functional import cached_property
from tango_shared.models import ContentImage, BaseUserContentModel, BaseSidebarContentModel
from tango_shared.utils.maptools import get_geocode
from tango_shared.utils.sanetize import sanetize_text
from .signals import update_time
    from tango_comments.models import Comment




#from tango_comments.models import Comment



supports_comments = False
if 'comments' in settings.INSTALLED_APPS:
    supports_comments = True



now = datetime.datetime.now()