显示模型属性我有使用GeoIP的库来渲染的IP地址该记录的国家的典范:从Django中对管理员
class PageIP(models.Model):
"""
Detail of page
"""
ip_address = models.IPAddressField(blank=True,verbose_name="IP Address")
def _client_country(self):
g = GeoIP()
return g.country(self.ip_address)
client_country = property(_client_country)
有什么办法,以显示在此属性(client_country) Django 1.1管理员?正如目前所写,这不会出现在管理员。
干杯。
Django在这里说:http://docs.djangoproject.com/en/dev/ref/models/fields/#ipaddressfield管理员表示这是一个(单行输入)。所以它应该肯定会出现 – 0100110010101 2009-10-12 18:40:52