django - int() argument must be a string, a bytes-like object or a number, not 'method' -


in django 1.8 /python 3.4

how can method int?

example:

models.py

class bid(models.model):     bid_price = models.integerfield(default=1)      def __str__(self):         return self.bid_price      def topprice(self):         return 100 

view.py

def bidview(request, bid_id):     bid_data = bid.objects.get(id=bid_id)     if int(bid_data.topprice_text) < 100): 

the way it's written method returning int, have call method use return value:

if bid_data.topprice() < 100:

i have don't quite know you're trying here, topprice shouldn't method anyways.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -