Method must be called with Class instance

2016-10-24 Thread Carlos GarcĂ­a
Hi, I'm creating a app which do a request to a API and the result is showing on a web page. My code is this: Models.py from django.db import models from django.template import Template, Context from django.http import HttpResponse import requests, json class HotelService(models.Model):

Re: Method must be called with Class instance

2016-10-24 Thread ludovic coues
It's a python error. First argument of method on an object is always the object itself, named self by convention. For exemple, class Greet: def hello(self, name): print("Hello %s!" % name) Python will take care of passing this argument when you call the method. 2016-10-24