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

I have a model formforms.pyclass (forms.ModelForm):class Meta:model = InfoPersonalfields = ['nam

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!!!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744060910a4551757.html

相关推荐

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

    I have a model formforms.pyclass (forms.ModelForm):class Meta:model = InfoPersonalfields = ['nam

    7天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信