Exemplo n.º 1
0
class SponsorRelationTranslation(
        get_translation_model(SponsorRelation, 'partner relation')):
    description = models.TextField(_(u'description'))

    class Meta:
        verbose_name = _(u'partner relation translation')
        verbose_name_plural = _(u'partner relation translations')
Exemplo n.º 2
0
class TicketTypeTranslation(get_translation_model(TicketType, 'TicketType')):
    title = models.CharField(_(u'title'), max_length=50)
    description = models.TextField(_(u'description'), blank=True)

    def __unicode__(self):
        return self.title

    class Meta:
        verbose_name = _(u'ticket type translation')
        verbose_name_plural = _(u'ticket type translation')
Exemplo n.º 3
0
class AxisTranslation(get_translation_model(Axis, "axis"), TranslationModel):
    """ Traduction d'axe de notation """

    # Champs
    name = models.CharField(max_length=32, blank=False, verbose_name=_("Name"))
    description = models.TextField(blank=True, verbose_name=_("Description"))

    # Métadonnées
    class Meta:
        app_label = 'social'
Exemplo n.º 4
0
class CompetitionTranslation(get_translation_model(Competition, 'competition')):
    translated_title = models.CharField(_(u'title'), max_length=50)
    translated_description = models.TextField(_(u'description'))

    def __unicode__(self):
        return self.translated_title

    class Meta:
        verbose_name = _(u'competition translation')
        verbose_name_plural = _(u'competition translations')
Exemplo n.º 5
0
class FlagTypeTranslation(get_translation_model(FlagType, "flagtype"), TranslationModel):
    """ Traduction de type de signalement """

    # Champs
    name = models.CharField(max_length=96, blank=False, verbose_name=_("Name"))
    description = models.TextField(blank=True, verbose_name=_("Description"))

    # Métadonnées
    class Meta:
        app_label = 'rogue'
Exemplo n.º 6
0
class LotteryTranslation(get_translation_model(Lottery, 'lottery')):
    title = models.CharField(_(u'title'), max_length=50)
    description = models.TextField(_(u'description'))

    def __unicode__(self):
        return self.title

    class Meta:
        verbose_name = _(u'lottery translation')
        verbose_name_plural = _(u'lottery translations')
Exemplo n.º 7
0
class ArticleTranslation(get_translation_model(Article, 'Article')):
    translated_title = models.CharField(_(u'title'), max_length=50)
    translated_body = models.TextField(_(u'content'))

    def __unicode__(self):
        return self.translated_title

    class Meta:
        verbose_name = _(u'news article translation')
        verbose_name_plural = _(u'news article translations')
Exemplo n.º 8
0
class OptionTranslation(get_translation_model(Option, "option"),
                        TranslationModel):
    """ Traduction des options """

    name = models.CharField(max_length=120,
                            blank=False,
                            verbose_name=_("Name"))
    description = models.TextField(blank=True, verbose_name=_("Description"))

    # Métadonnées
    class Meta:
        app_label = 'core'
Exemplo n.º 9
0
class FAQTranslation(get_translation_model(FAQ, "faq"), TranslationModel):
    """ Traduction des pages """

    # Champs
    question = models.CharField(max_length=240,
                                blank=False,
                                verbose_name=_("Question"))
    answer = models.TextField(blank=False, verbose_name=_("Text"))

    # Métadonnées
    class Meta:
        app_label = 'help'
Exemplo n.º 10
0
class EventCategoryTranslation(
        get_translation_model(EventCategory, "eventcategory"),
        TranslationModel):
    """ Traduction de catégorie d'événements """

    # Champs
    name = models.CharField(max_length=48, blank=False, verbose_name=_("Name"))
    description = models.TextField(blank=True, verbose_name=_("Description"))

    # Métadonnées
    class Meta:
        app_label = 'social'
Exemplo n.º 11
0
class OptionGroupTranslation(get_translation_model(OptionGroup, "optiongroup"), TranslationModel):
    """ Traduction de groupe d'options """

    # Champs
    name = models.CharField(max_length=80, blank=False, verbose_name=_("Name"))
    description = models.TextField(blank=True, verbose_name=_("Description"))

    # Overrides
    def natural_key(self):
        return self.model, self.language

    # Métadonnées
    class Meta:
        app_label = 'core'
Exemplo n.º 12
0
class PageTranslation(get_translation_model(Page, "page"), TranslationModel):
    """ Traduction des pages """

    # Champs
    title = models.CharField(max_length=128,
                             blank=False,
                             verbose_name=_("Title"))
    text = models.TextField(blank=False,
                            help_text=_("Markdown"),
                            verbose_name=_("Text"))

    # Métadonnées
    class Meta:
        app_label = 'help'
Exemplo n.º 13
0
class ExcerptTranslation(get_translation_model(Excerpt, "excerpt"),
                         TranslationModel):
    """ Traduction d'un extrait """
    text = models.TextField(blank=False, verbose_name=_("Text"))

    # Overrides
    def __str__(self):
        """ Renoyer la représentation chaîne de l'objet """
        return "Excerpt {uuid}/{lang}".format(uuid=self.model.uuid,
                                              lang=self.language)

    # Métadonnées
    class Meta:
        app_label = 'editorial'
Exemplo n.º 14
0
class AhMatClassTranslation(get_translation_model(AhMatClass, "ahmatclass")):
    display_name = models.CharField(
        max_length=200,
        verbose_name=_('Material class display name'),
        help_text=_("Name of the material class for displaying"),
        null=True,
        blank=True,
    )
    mat_class_description = models.TextField(
        verbose_name=_('Material class description'),
        help_text=_("Text to describe the material class."),
        null=True,
        blank=True,
        unique=False,
    )
Exemplo n.º 15
0
class MailTypeTranslation(get_translation_model(MailType, "mailtype"),
                          TranslationModel):
    """ Traduction du type de mail """
    description = models.TextField(blank=True, verbose_name=_("Description"))

    # Overrides
    def save(self, *args, **kwargs):
        """ Enregistrer l'objet dans la base de données """
        super(MailTypeTranslation, self).save(*args, **kwargs)

    def __str__(self):
        """ Renvoyer la représentation chaîne de l'objet """
        return "Mail type {name}/{lang}".format(name=self.model.short_name,
                                                lang=self.language)

    # Métadonnées
    class Meta:
        app_label = 'messaging'
Exemplo n.º 16
0
class PageTranslation(get_translation_model(Page, "page")):
    title = models.CharField(max_length=150, blank=False, null=False)
    subtitle = models.CharField(max_length=150, blank=False, null=False)
    slug =  models.SlugField(max_length=150,blank=False, null=False)
    content = models.TextField(blank=False, null=False)

    meta_title = models.CharField("Title",max_length=255, null=True, blank=True)
    meta_description = models.CharField("Description",max_length=255, null=True, blank=True)
    meta_keywords = models.CharField("Keywords",max_length=255, null=True, blank=True)

    created_at = models.DateTimeField(auto_now = True)
    modified_at = models.DateTimeField(auto_now_add = True)

    def __str__(self):
        return self.model.name

    class Meta:
        verbose_name = "Page"
        verbose_name_plural = "Pages"
Exemplo n.º 17
0
class LabelTranslation(get_translation_model(Label, "label"),
                       TranslationModel):
    """ Traduction de type de contenu """

    # Champs
    name = models.CharField(max_length=64, blank=False, verbose_name=_("Name"))
    description = models.TextField(blank=True, verbose_name=_("Description"))
    html = models.TextField(blank=True, verbose_name=_("HTML description"))

    # Overrides
    def save(self, *args, **kwargs):
        """ Enregistrer l'objet dans la base de données """
        super(LabelTranslation, self).save(*args, **kwargs)

    # Métadonnées
    class Meta:
        verbose_name = _("translation")
        verbose_name_plural = _("translations")
        app_label = 'forum'
Exemplo n.º 18
0
class VenueTypeTranslation(get_translation_model(VenueType, "venuetype"),
                           TranslationModel):
    """ Traduction de type de lieu """

    name = models.CharField(max_length=48, blank=False, verbose_name=_("Name"))
    plural = models.CharField(max_length=48,
                              blank=False,
                              default="__",
                              verbose_name=_("Plural"))
    description = models.TextField(blank=True, verbose_name=_("Description"))

    # Overrides
    def save(self, *args, **kwargs):
        """ Enregistrer l'objet dans la base de données """
        if self.plural == '__':
            self.plural = "{}s".format(self.name)
        super(VenueTypeTranslation, self).save(*args, **kwargs)

    # Métadonnées
    class Meta:
        app_label = 'location'
Exemplo n.º 19
0
class CategoryTranslation(get_translation_model(Category, "category"),
                          TranslationModel, models.Model):
    """ Traduction de type de contenu """

    # Champs
    name = models.CharField(max_length=64, blank=False, verbose_name=_("Name"))
    plural = models.CharField(max_length=64,
                              blank=False,
                              default="__",
                              verbose_name=_("Plural"))
    description = models.TextField(blank=True, verbose_name=_("Description"))

    # Overrides
    def save(self, *args, **kwargs):
        """ Enregistrer l'objet dans la base de données """
        if self.plural == self._meta.get_field('plural').default:
            self.plural = "{}s".format(self.name)
        super(CategoryTranslation, self).save(*args, **kwargs)

    # Métadonnées
    class Meta:
        app_label = 'content'
        verbose_name = _("translation")
        verbose_name_plural = _("translations")
Exemplo n.º 20
0
class TroubleShootingTranslation(get_translation_model(TroubleShooting, "troubleshooting")):
    question = models.CharField(max_length=255)
    answer = models.TextField()
Exemplo n.º 21
0
class CategoryTranslation(get_translation_model(Category, "Category")):
    title = models.CharField(max_length=255)
Exemplo n.º 22
0
class CertificationTranslation(get_translation_model(Certification, "certification")):
    title = models.CharField(max_length=255)
    content = models.TextField()

    def __str__(self):
        return self.title
Exemplo n.º 23
0
class BabyTimesTranslation(get_translation_model(BabyTimes, "babytimes")):
    title = models.CharField(max_length=255)
    timestamp = models.DateField()
    content = models.TextField()
Exemplo n.º 24
0
class Translation(get_translation_model(Translatable, "translatable")):

    field = models.CharField("field", max_length=20)

    def __unicode__(self):
        return self.field
Exemplo n.º 25
0
class SponsorTranslation(get_translation_model(Sponsor, 'Sponsor')):
    description = models.TextField(_(u'description'))

    class Meta:
        verbose_name = _(u'sponsor translation')
        verbose_name_plural = _(u'sponsor translations')
Exemplo n.º 26
0
class LANTranslation(get_translation_model(LAN, 'LAN')):
    description = models.TextField(_(u'description'))

    class Meta:
        verbose_name = _(u'LAN translation')
        verbose_name_plural = _(u'LAN translations')
Exemplo n.º 27
0
            pass 
        return None

    def __unicode__(self):
        return self.name


    def get_member_names(self):
        return "%s." % ', '.join(m.name for m in self.members.all())

    @models.permalink
    def get_absolute_url(self):
        return ('superme_project_detail', None, {'slug' : self.name })


_PT = get_translation_model(Project, 'project')
class ProjectTranslation(_PT):    
    short_description = models.TextField()
    description = models.TextField(blank = True)



## Project images
class ProjectImage(TranslatableModel):
    project = models.ForeignKey(Project, related_name = 'photos')
    original_image = models.ImageField(upload_to = 'superme/project_images')
    thumbnail_small = ThumbnailImageSpec(**PROJECT_THUMBNAIL_SIZES['small'])
    thumbnail_medium = ThumbnailImageSpec(**PROJECT_THUMBNAIL_SIZES['medium'])
    thumbnail_large = ThumbnailImageSpec(**PROJECT_THUMBNAIL_SIZES['large'])

    # Meta info, show this as the first image when showcasing this product