+ exclude = ['project']
+
+ def __init__(self, *args, **kwargs):
+ ret = super(BookForm, self).__init__(*args, **kwargs)
+ self.fields['slug'].widget.attrs.update({"class": "autoslug"})
+ self.fields['title'].widget.attrs.update({"class": "autoslug-source"})
+ return ret
+
+
+class ReadonlyBookForm(BookForm):
+ """Form used for not editing a Book."""
+
+ def __init__(self, *args, **kwargs):
+ ret = super(ReadonlyBookForm, self).__init__(*args, **kwargs)
+ for field in self.fields.values():
+ field.widget.attrs.update({"readonly": True})
+ return ret