Created
March 9, 2014 18:54
-
-
Save mineta/9452585 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
class House(models.Model): | |
location = models.CharField( | |
max_length=200, | |
verbose_name=_("Location"), | |
help_text=_("Enter the location of the house"), | |
) | |
rooms = models.PositiveSmallIntegerField( | |
verbose_name=_("Number of rooms"), | |
help_text=_("Enter the number of rooms of the House"), | |
) | |
balkon = models.BooleanField( | |
verbose_name=_("Has balkon"), | |
help_text=_("Enter if the house has a balkon or not"), | |
) | |
class Meta: | |
verbose_name = _('House') | |
verbose_name_plural = _('Houses') | |
ordering = ["location"] | |
def __unicode__(self): | |
return _("House located at %s") % self.location | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment