Skip to content

Instantly share code, notes, and snippets.

@aviars
Created March 16, 2011 15:07
Show Gist options
  • Save aviars/872623 to your computer and use it in GitHub Desktop.
Save aviars/872623 to your computer and use it in GitHub Desktop.
foee4 k-dog
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