Created
March 16, 2011 15:07
-
-
Save aviars/872623 to your computer and use it in GitHub Desktop.
foee4 k-dog
This file contains 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
from django.db import models | |
from django.utils.translation import ugettext as _, ugettext_lazy as __ | |
class FeatureType(models.Model): | |
class Meta: | |
verbose_name = __("FeatureType") | |
verbose_name_plural = __("FeatureTypes") | |
ordering = ('name',) | |
name = models.CharField(max_length=75) | |
slug = models.CharField(max_length=75) | |
def __unicode__(self): | |
return self.name | |
class FacilityType(models.Model): | |
class Meta: | |
verbose_name = __("FacilityType") | |
verbose_name_plural = __("FacilityTypes") | |
ordering = ('name',) | |
name = models.CharField(max_length=75) | |
slug = models.CharField(max_length=75) | |
duplicate_distance_tolerance= models.IntegerField(default=1) | |
def __unicode__(self): | |
return self.name | |
"""build the facility type""" | |
try: | |
facility_type_list=[] | |
ft=FacilityType.objects.all() | |
for i in ft: | |
facility_type_list.append(i.slug) | |
facility_type_list2=facility_type_list | |
facility_type_list=tuple(facility_type_list) | |
properties_feature_type_choices_tuple=tuple(facility_type_list) | |
properties_feature_type_choices=tuple(zip(facility_type_list, facility_type_list2)) | |
except(): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment