# Path: survey/helpers.py
# def total_seconds(td):


from django.db import models
from datetime import datetime
from django.contrib.auth.models import User
from collections import defaultdict
from survey.helpers import now, get_current_timezone
            new_question = question
            new_question.id = None
            new_question.survey = other
            new_question.group = groups[question.group]
            new_question.save()
            # copy the choices
            for choice in choice_set:
                new_choice = choice
                new_choice.id = None
                new_choice.question = new_question
                new_choice.save()

    @property
    def closed(self):
        return self.end_date and self.end_date <= now()

    @property
    def is_unpublished(self):
        return not self.is_active and not self.closed

    def track(self, on=True):
        self.use_cookies = on
        self.save()

    def social(self, on=True):
        self.show_social = on
        self.save()

    def publish(self, dt=None):
        if dt is None:

# Path: survey/helpers.py
# def total_seconds(td):


# Path: survey/models.py
from django.db import models
from datetime import datetime
from django.contrib.auth.models import User
from collections import defaultdict
from survey.helpers import now, get_current_timezone

            new_question = question
            new_question.id = None
            new_question.survey = other
            new_question.group = groups[question.group]
            new_question.save()
            # copy the choices
            for choice in choice_set:
                new_choice = choice
                new_choice.id = None
                new_choice.question = new_question
                new_choice.save()

    @property
    def closed(self):
        return self.end_date and self.end_date <= now()

    @property
    def is_unpublished(self):
        return not self.is_active and not self.closed

    def track(self, on=True):
        self.use_cookies = on
        self.save()

    def social(self, on=True):
        self.show_social = on
        self.save()

    def publish(self, dt=None):
        if dt is None:

            dt = now()