• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


28 Mar, 2025

Updated at 18 May, 2025

fieldsets(legend) in modelform django

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

{% include "_parts/form.html" with 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 and fields to be inside the tag

(legend)enter image description here

how to implement it help please!!!