I want to generate a list using my django model
say I have these model:
class AlarmServer(models.Model):
ip = models.IPAddressField()
and such a list
server_ips = [i.ipfor i in AlarmServer.objects.all()]
Doesn’t seem to work, what am I doing wrong?
Should work (I just added a space). I’ve tried this as below