fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a@name to @id
[edumed.git]
/
curriculum
/
models.py
diff --git
a/curriculum/models.py
b/curriculum/models.py
index
004e78e
..
ad98877
100644
(file)
--- a/
curriculum/models.py
+++ b/
curriculum/models.py
@@
-50,11
+50,11
@@
class Competence(models.Model):
@classmethod
def from_text(cls, text):
"""Tries to return a Competence or a Section."""
@classmethod
def from_text(cls, text):
"""Tries to return a Competence or a Section."""
- parts =
text.rsplit(u'\u2013'
, 1)
+ parts =
re.split(ur'[-\u2013]', text
, 1)
if len(parts) == 1:
return Section.objects.get(name__iexact=text.strip())
else:
if len(parts) == 1:
return Section.objects.get(name__iexact=text.strip())
else:
- return cls.objects.get(name__iexact=parts[1])
+ return cls.objects.get(name__iexact=parts[1]
.strip()
)
class Level(models.Model):
group = models.CharField(_('group'), max_length=255)
class Level(models.Model):
group = models.CharField(_('group'), max_length=255)