from django.db import models
class Country(models.Model):
 code=models.CharField(max_length=2,unique=True); name=models.CharField(max_length=100); dialing_code=models.CharField(max_length=8,blank=True)
 class Meta: ordering=['name']
 def __str__(self): return self.name
class Campus(models.Model):
 name=models.CharField(max_length=150); slug=models.SlugField(unique=True); country=models.ForeignKey(Country,on_delete=models.PROTECT,related_name='campuses'); institution=models.CharField(max_length=180); city=models.CharField(max_length=100,blank=True); active=models.BooleanField(default=True)
 class Meta: ordering=['country__name','name']; unique_together=[('country','name')]
 def __str__(self): return self.name
class Industry(models.Model):
 name=models.CharField(max_length=120,unique=True); active=models.BooleanField(default=True); display_order=models.PositiveSmallIntegerField(default=100)
 class Meta: ordering=['display_order','name']; verbose_name_plural='Industries'
 def __str__(self): return self.name
