Hi,--I am attempting to write a python script that will populate the Django db from data stored in a dictionary.I'm currently getting the error :"TypeError: unbound method save() must be called with NagiosLog instance as first argument (got nothing instead)"from incidents.models import NagiosLogimport djangoxcount = 0for k,v in myDic.items():iincidentnumber = kitime =v[0]idevice =v[2]iservice =v[3]iseverity =v[4]imessage =v[5]print "%r %r %r %r %r" % (itime,idevice,iservice,iseverity,imessage,) ## prints successfully, code working until herexcount= xcount+1if xcount == 1: # count to run django setup a single timedjango.setup()k = NagiosLog(incident = iincidentnumber,time = itime,device = idevice,service = iservice,severity = iseverity,message = imessage,)NagiosLog.save()else:k = NagiosLog(incident = iincidentnumber,time = itime,device = idevice,service = iservice,severity = iseverity,message = imessage,)NagiosLog.save()This is my models file:from django.db import modelsfrom django.utils import timezoneimport datetimeclass NagiosLog(models.Model):incident = models.CharField(primary_key=True, max_length=80)time = models.CharField(max_length=80, blank=True, null=True)device = models.CharField(max_length=80, blank=True, null=True)service = models.CharField(max_length=80, blank=True, null=True)severity = models.CharField(max_length=20, blank=True, null=True)message = models.CharField(max_length=250, blank=True, null=True)Any help appreciated !Thanks, Phil.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1cc3eda3-d180-430e-8e41-866dceb0bca2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei1x51MjhDZCXJPT59kRJLpSGoq6B2Du5xxBggDq1uvRuA%40mail.gmail.com.