最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - fieldsets(legend) in modelform django - Stack Overflow

programmeradmin0浏览0评论

I have a model form

forms.py

class (forms.ModelForm):
  class Meta:
  model = InfoPersonal
  fields = [
            'name',
            'phone_number'
           ]

models.py

class InfoPersonal(models.Model):
  name = models.CharField(_('Имя'), max_length=50)
  phone_number = PhoneNumberField(
        _('Номер телефона'), max_length=20, unique=True, blank=True, null=True,

personal_info-add.html

<form enctype="multipart/form-data"
    action="{% url 'workflows:personal_info-add' user.pk %}" method="post">
    {% include "_parts/form.html" with form=form %}
</form>

I want to get the result as shown in the picture( email -> name passord -> tel). Is it possible to add a tag in the module itself?

I need the <name> and <phone_number> fields to be inside the tag <fieldset> (legend)enter image description here

how to implement it help please!!!

发布评论

评论列表(0)

  1. 暂无评论