# Path: wbc/core/models.py
# class Model(models.Model):
#     created = models.DateTimeField(editable=False)
#     updated = models.DateTimeField(editable=False)
# 
#     def save(self, *args, **kwargs):
#         if not self.id:
#             self.created = now()
# 
#         self.updated = now()
#         super(Model, self).save(*args, **kwargs)
# 
#     class Meta:
#         abstract = True
# 
# Path: wbc/region/models.py
# class Entity(Model):
#     name = models.CharField(max_length=256)
#     description = models.TextField(blank=True)
#     lat = models.FloatField(null=True, blank=True)
#     lon = models.FloatField(null=True, blank=True)
#     polygon = models.TextField(blank=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     class Meta:
#         verbose_name = 'Einheit'
#         verbose_name_plural = 'Einheiten'
# 
# class Department(Model):
#     name = models.CharField(max_length=256)
#     description = models.TextField(blank=True)
#     link = models.URLField(blank=True)
#     entity = models.ForeignKey(Entity, related_name='departments')
# 
#     def __unicode__(self):
#         return self.name
# 
#     class Meta:
#         verbose_name = 'Behörde'
#         verbose_name_plural = 'Behörden'


from django.db import models
from django.core.urlresolvers import reverse
from wbc.core.models import Model
from wbc.region.models import Entity,Department
    def __str__(self):
        return str(self.place) + ', ' + self.process_step.name

    def __unicode__(self):
        return unicode(self.__str__())

    class Meta:
        ordering            = ("-end",)
        verbose_name        = u"Veröffentlichung"
        verbose_name_plural = u"Veröffentlichungen"

class ProcessStep(Model):
    name         = models.CharField(max_length=256, verbose_name="Name")
    description  = models.TextField(verbose_name="Beschreibung")
    icon         = models.CharField(max_length=256, verbose_name="Icon auf der Karte")
    hover_icon   = models.CharField(max_length=256, verbose_name="Icon auf der Karte bei Hovereffekt")
    order        = models.IntegerField(verbose_name="Reihenfolge", help_text="Nummer in der Reihenfolge")
    process_type = models.ForeignKey('ProcessType', related_name='process_steps', verbose_name="Verfahren")

    def __str__(self):
        return str(self.process_type) + ', ' + self.name

    def __unicode__(self):
        return unicode(self.__str__())

    class Meta:
        ordering            = ("process_type","order")
        verbose_name        = "Verfahrensschritt"
        verbose_name_plural = "Verfahrensschritte"


# Path: wbc/core/models.py
# class Model(models.Model):
#     created = models.DateTimeField(editable=False)
#     updated = models.DateTimeField(editable=False)
# 
#     def save(self, *args, **kwargs):
#         if not self.id:
#             self.created = now()
# 
#         self.updated = now()
#         super(Model, self).save(*args, **kwargs)
# 
#     class Meta:
#         abstract = True
# 
# Path: wbc/region/models.py
# class Entity(Model):
#     name = models.CharField(max_length=256)
#     description = models.TextField(blank=True)
#     lat = models.FloatField(null=True, blank=True)
#     lon = models.FloatField(null=True, blank=True)
#     polygon = models.TextField(blank=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     class Meta:
#         verbose_name = 'Einheit'
#         verbose_name_plural = 'Einheiten'
# 
# class Department(Model):
#     name = models.CharField(max_length=256)
#     description = models.TextField(blank=True)
#     link = models.URLField(blank=True)
#     entity = models.ForeignKey(Entity, related_name='departments')
# 
#     def __unicode__(self):
#         return self.name
# 
#     class Meta:
#         verbose_name = 'Behörde'
#         verbose_name_plural = 'Behörden'


# Path: wbc/process/models.py
from django.db import models
from django.core.urlresolvers import reverse
from wbc.core.models import Model
from wbc.region.models import Entity,Department

    def __str__(self):
        return str(self.place) + ', ' + self.process_step.name

    def __unicode__(self):
        return unicode(self.__str__())

    class Meta:
        ordering            = ("-end",)
        verbose_name        = u"Veröffentlichung"
        verbose_name_plural = u"Veröffentlichungen"

class ProcessStep(Model):
    name         = models.CharField(max_length=256, verbose_name="Name")
    description  = models.TextField(verbose_name="Beschreibung")
    icon         = models.CharField(max_length=256, verbose_name="Icon auf der Karte")
    hover_icon   = models.CharField(max_length=256, verbose_name="Icon auf der Karte bei Hovereffekt")
    order        = models.IntegerField(verbose_name="Reihenfolge", help_text="Nummer in der Reihenfolge")
    process_type = models.ForeignKey('ProcessType', related_name='process_steps', verbose_name="Verfahren")

    def __str__(self):
        return str(self.process_type) + ', ' + self.name

    def __unicode__(self):
        return unicode(self.__str__())

    class Meta:
        ordering            = ("process_type","order")
        verbose_name        = "Verfahrensschritt"
        verbose_name_plural = "Verfahrensschritte"


class ProcessType(Model):