Hit a hiccup with trying to print out an object. Not sure what is going on. The debug below is from the script console.
from shared.scheduler.model import ScheduleEntry
new = ScheduleEntry(1,2,3,4,5,6,7,8)
print str(new)
class test:
def __init__(self):
self.id = 1
def __str__(self):
return "string"
t = test()
print t
This is the class for ScheduleEntry:
class ScheduleEntry:
def __init__(self, id, priority, loadDate, startDate, endDate, recipe, minDosingTime, status):
self.id = id
self.priority = priority
self.loadDate = loadDate
self.startDate = startDate
self.endDate = endDate
self.recipe = recipe
self.minDosingTime = minDosingTime
self.status = status
self.segmentsByDay = {}
self.newEntry = False
def __str__(self):
return "string"
When I print out “new” I just get the representation of the object and not the string as expected but when I print out “t”, I get the string as expected
Console Output
>>>
<model.ScheduleEntry instance at 0xd>
string
>>>