W
W
WebAirStudio2020-05-17 12:01:43
Django
WebAirStudio, 2020-05-17 12:01:43

Settle the dispute?

Hello. The page was made up on bootstrap4 and handed over to the customer.
The Django backend developer does not like the layout, since supposedly django by default generates a form with its own layout different from what I have laid out, and besides, django accepts and validates the form in some other way, using some standard django tools, which I don’t know about known, since I'm not a django developer and not even a python.
To my objections that you can receive data from the form using ajax to the script handler and in the template engine you can customize the form as you like, and not just how django generates by default, the developer says that this is double work.

I googled a little on this topic. Is it difficult and strong double work if you do this?
controller

email = forms.EmailField(
        label='Email'
        id='input-email',
        class='form-control form-control-sm',
        type='email',
        name='input-email',
        value=emailValueFromDB,
        placeholder='[email protected]',
        maxlength=32, 
        required=True,
        disabled=True,
    )


view
<div class="form-group mb-2">
<label class="col-form-label col-form-label-sm text-muted" for="{{ form.email.id }}">{{ form.email.label }}</label>
{{ form.email }}
</div>


Should I change the developer's backend or am I incompetent?

UPD: Backend developer response
5ec102581c402384958566.jpeg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Gornostaev, 2020-05-17
@WebAirStudio

The troubles of the backender should not concern you, you did your job normally, as far as I can tell. If the backender wants to use Django's form generation tools, it can either remove your form layout or use it to generate it in boilerplate code. It looks like he just doesn't know how to work with bootstrap forms. And accepting a form with an ajax request isn't double work if the backing is well written.

V
Vadim Shatalov, 2020-05-17
@netpastor

Dispute between the deaf and the dumb
When you were given a task, you should have clearly indicated the way the front and back interacted - ajax or standard post - this is according to the way of interaction. It's the same with validation - such questions should be asked at the beginning of work
. In general, validation on the server of such simple things as the validity of a mailing address or the fullness of all required fields and similar cases is the last century.
As for the layout you don’t like - here the backender is wrong - you can not use the layout of the forms issued by Django at all, but just work out what came in normally - follow the rules for naming the fields

V
Vladimir Korotenko, 2020-05-17
@firedragon

In general, client and server validation do not overlap at all. On the client, you check the validity of the soap, whether the person is 18.21 years old, an error in entering a credit card. Required fields. On the server, you validate the nickname, the user's country, and the required fields. All that cannot be validated on the client. Roughly speaking, edit typos on the client and get the final answer on the server. Therefore, voice this idea to the customer and backender

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question