@@ -83,11 +83,9 @@ STREAMBLOCKS_MODELS = [
8383 ImageWithText
8484]
8585```
86-
8786> Important!: Don't use 'as_list', 'options', 'extra_options' as models field names, because they are used by streamfield.
8887
89-
90- ** 2. Add apps to settings.py**
88+ ** 2. Add apps to settings.py and make migrations**
9189
9290Add to INSTALLED_APPS
9391
@@ -98,6 +96,7 @@ INSTALLED_APPS = [
9896 ' streamfield' ,
9997 ...
10098```
99+ Run `python manage.py makemigrations` and `python manage.py migrate`
101100
102101** 3 . Add streamfield.urls to main urls.py**
103102```python
@@ -327,6 +326,11 @@ class Slide(models.Model):
327326 {' value' : ' wide' , ' name' : ' Wide slider' },
328327 {' value' : ' narrow' , ' name' : ' Narrow slider' },
329328 ]
329+ },
330+ ' class_name' : {
331+ ' label' : ' Class Name' ,
332+ ' type' : ' text' ,
333+ ' default' : ' '
330334 }
331335 }
332336
@@ -336,7 +340,7 @@ class Slide(models.Model):
336340```
337341In block template you can use this options as `options.autoplay`
338342In page admin you will see it on the bottom of this block.
339- > Note: Now only " checkbox" and " select" type is working.
343+ > Note: Now only " checkbox" , " text " and " select" type is working.
340344You may apply options for all blocks with `STREAMFIELD_BLOCK_OPTIONS ` (See [Settings](# settings))
341345
342346If you want to add block options to options, which was set in django settings, you may use `extra_options` .
@@ -473,5 +477,5 @@ STREAMFIELD_BLOCK_OPTIONS = {
473477```
474478In block template use `{{ options.margins }}`
475479
476- > Note: Now only " checkbox" and " select" type is working.
480+ > Note: Now only " checkbox" , " text " , and " select" type is working.
477481
0 commit comments