fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
98e406a
)
fix initial in tag forms
author
Jan Szejko
<janek37@gmail.com>
Tue, 25 Apr 2017 09:08:17 +0000
(11:08 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 25 Apr 2017 09:08:17 +0000
(11:08 +0200)
apps/catalogue/forms.py
patch
|
blob
|
history
diff --git
a/apps/catalogue/forms.py
b/apps/catalogue/forms.py
index
4b6a37b
..
36dbef7
100644
(file)
--- a/
apps/catalogue/forms.py
+++ b/
apps/catalogue/forms.py
@@
-52,7
+52,7
@@
class TagForm(forms.Form):
'data-content': category.tutorial,
})
if self.instance:
'data-content': category.tutorial,
})
if self.instance:
- self.field().initial = self.initial()
+ self.field().initial = self.
get_
initial()
def save(self, instance=None):
instance = instance or self.instance
def save(self, instance=None):
instance = instance or self.instance
@@
-62,7
+62,7
@@
class TagForm(forms.Form):
def field(self):
raise NotImplementedError
def field(self):
raise NotImplementedError
- def initial(self):
+ def
get_
initial(self):
raise NotImplementedError
def cleaned_tags(self):
raise NotImplementedError
def cleaned_tags(self):
@@
-107,7
+107,7
@@
class TagSingleForm(TagForm):
def field(self):
return self.fields['tag']
def field(self):
return self.fields['tag']
- def initial(self):
+ def
get_
initial(self):
return self.instance.tags.get(category=self.category)
def cleaned_tags(self):
return self.instance.tags.get(category=self.category)
def cleaned_tags(self):
@@
-125,7
+125,7
@@
class TagMultipleForm(TagForm):
def field(self):
return self.fields['tags']
def field(self):
return self.fields['tags']
- def initial(self):
+ def
get_
initial(self):
return self.instance.tags.filter(category=self.category)
def cleaned_tags(self):
return self.instance.tags.filter(category=self.category)
def cleaned_tags(self):