Opened 18 years ago
Closed 18 years ago
#3524 closed (invalid)
Models: Sub String for a character field
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I was wondering if in a Model you can substring
For example
State = models.Charfield(maxlength=3)
Fileid = models.Charfield(maxlength=10)
Date = models.DateField
and the following definition
def save(self):
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?
Regards
Note:
See TracTickets
for help on using tickets.
Please post support requests to the mailing list. This is for bug reports. Thankyou.