Opened 9 years ago

Closed 9 years ago

#3524 closed (invalid)

Models: Sub String for a character field

Reported by: richard.freitag@… Owned by: jacob
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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?


Change History (1)

comment:1 Changed 9 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Please post support requests to the mailing list. This is for bug reports. Thankyou.

Note: See TracTickets for help on using tickets.
Back to Top