from django.db import models class IPLocation(models.Model): ip = models.CharField(max_length=32, primary_key=True) country = models.CharField(max_length=32, blank=True, null=True) region = models.CharField(max_length=32, blank=True, null=True) city = models.CharField(max_length=32, blank=True, null=True) class Meta: db_table = 'pingcap_ip_location' @property def location(self): return f'{self.country} {self.region} {self.city}'