mezzanine_events/models.py
def duplicate(self):
        """
        Create a copy of an existing Event instance.
        Used by staff users to speed-up creation of similar events.
        """
        dup = self.__class__.objects.get(pk=self.pk)
        dup.pk = None
        dup.title = "[Duplicate] %s" % self.title
        dup.slug = ""  # Let Mezzanine generate a unique slug
        dup.save()

        # Add the same categories
        dup.categories.add(*self.categories.all())

        # Duplicate EventDateTime instances
        for dt in self.occurrences.all():
            dt.pk = None
            dt.event = dup
            dt.save()

        return dup

        Create a copy of an existing Event instance.
        Used by staff users to speed-up creation of similar events.
        
Create a copy of an existing Event instance.
Used by staff users to speed-up creation of similar events.
Create a copy of an existing Event instance . Used by staff users to speed - up creation of similar events .
def duplicate(self):
        dup = self.__class__.objects.get(pk=self.pk)
        dup.pk = None
        dup.title = "[Duplicate] %s" % self.title
        dup.slug = ""  
        dup.save()
        dup.categories.add(*self.categories.all())
        for dt in self.occurrences.all():
            dt.pk = None
            dt.event = dup
            dt.save()
        return dup
def duplicate ( self ) : dup = self . __class__ . objects . get ( pk = self . pk ) dup . pk = None dup . title = "[Duplicate] %s" % self . title dup . slug = "" dup . save ( ) dup . categories . add ( * self . categories . all ( ) ) for dt in self . occurrences . all ( ) : dt . pk = None dt . event = dup dt . save ( ) return dup
Create a copy of an existing Event instance.
Create a copy of an existing Event instance .
"""
        Create a copy of an existing Event instance.
        Used by staff users to speed-up creation of similar events.
        """ # Let Mezzanine generate a unique slug # Add the same categories # Duplicate EventDateTime instances
self