Opened 15 years ago
Closed 15 years ago
#11669 closed (invalid)
Hand in HandField
Reported by: | joebrown | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.1 |
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 *think* this is an error, tho I'm not sure, it's caused me confusion either way... isinstance supposed to be Hand or HandField?
class HandField(models.Field):
# ...
def to_python(self, value):
if isinstance(value, Hand):
return value
# The string case.
p1 = re.compile('.{26}')
p2 = re.compile('..')
args = [p2.findall(x) for x in p1.findall(value)]
return Hand(*args)
Thanks for the work eitherway.
Note:
See TracTickets
for help on using tickets.
The current text is correct, please use the django-users mailing list and #django channel on freenode for asking support questions, not the ticket tracker.