Code

Opened 7 years ago

Closed 7 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:

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

Attachments (0)

Change History (1)

comment:1 Changed 7 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.