Last time I checked, (h) one argument:
for entry in f['entries']:
h = {'feed':self, 'link': entry['link'],'title':entry['title'],
'summary':entry['summary'],
'updated_at':datetime.fromtimestamp(mktime(entry['updated_parsed']))}
en = Entry.objects.get_or_create(h)
This code is failing with the error in the title. What can I check for?
get_or_create
takes keyword arguments only. If the arguments are in a dict, you can call it with:
en = Entry.objects.get_or_create(**h)
Or you can put the keyword arguments directly:
en = Entry.objects.get_or_create(name=value, ....)
The reason the error message told you that you supplied two arguments is that there is an implicit self
parameter passed to the function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With