Piki is a minimal wiki
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

forms.py 567B

1234567891011121314
  1. from typing import Any, Mapping
  2. from django import forms
  3. from django.forms.renderers import BaseRenderer
  4. from django.forms.utils import ErrorList
  5. class EditForm(forms.Form): # Note that it is not inheriting from forms.ModelForm
  6. page_txt = forms.CharField(max_length=20000, label="Page source text", widget=forms.Textarea(attrs={"rows": "20"}))
  7. def __init__(self, *args, **kwargs) -> None:
  8. page_data = kwargs.pop("page_data")
  9. super().__init__(*args, **kwargs)
  10. page_txt = self.fields['page_txt']
  11. page_txt.initial = page_data