I have model Specification with field description. I am tring to create form where user can create new Specification object by adding text, picture to description field. I have 2 problems.
1) When I add picture from computer I dont see it inside field however I see that picture in media_root. How to fix this problem?!
2) When I click submit button, it dont create new Specification object. It just show my form with content without editing. I thought next my code would be create new object and update list of objects.
class Specification(models.Model):
*******
description = models.TextField(_('Description'))
*******
forms.py:
class SpecificationForm(forms.ModelForm):
description = forms.CharField(widget=SummernoteInplaceWidget(attrs={'width': '100%'}))
class Meta:
model = Specification
fields = ('description',)
Hello! First of all THANK YOU for this project!
I have model Specification with field description. I am tring to create form where user can create new Specification object by adding text, picture to description field. I have 2 problems.
1) When I add picture from computer I dont see it inside field however I see that picture in media_root. How to fix this problem?!
2) When I click submit button, it dont create new Specification object. It just show my form with content without editing. I thought next my code would be create new object and update list of objects.
settings.py:
models.py:
forms.py:
urls.py:
views.py:
specification_add.html: