Opened 17 years ago

Closed 17 years ago

#3524 closed (invalid)

Models: Sub String for a character field

Reported by: richard.freitag@… 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

Change History (1)

comment:1 by Malcolm Tredinnick, 17 years ago

Resolution: invalid
Status: newclosed

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