Models: Sub String for a character field
|Reported by:||richard.freitag@…||Owned by:||jacob|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I was wondering if in a Model you can substring
State = models.Charfield(maxlength=3)
Fileid = models.Charfield(maxlength=10)
Date = models.DateField
and the following definition
d = self.Date
state = self.State
self.Fileid = dateformat.format(d, "Y")+self.state(1,1) <------- This is where I would substring I assume.
super(case_file, self).save() #Calls the real Save function
This doesn't appear to work, would you have any suggestions?