Hi,

I did change as per your advise,, no errors , but no changes  field 2 (cmonth)  
 not got value from  field1   (month) below is my views.py

 



 

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Sebastian Jung
Sent: 29 January 2022 05:03
To: django-users@googlegroups.com
Subject: Re: copy value from field1 to field2

 

Hello,

 

i think this is easy. When customer submit post data to django and form is 
valid. then you make following.

 

formentry = form.save(commit=False)
 
formentry.field2 = formentry.cleaned_data['field1']
 
formentry.save()
This is untested but i am very sure that this works....
Regards

 

Am Fr., 28. Jan. 2022 um 20:51 Uhr schrieb Feroz Ahmed <feroz.r...@gmail.com>:

Hi,

I am new to django,

I have field1 as dropdown with mentioned months name

filed2 is none and excluded in forms

 

I want while inserting the data , if I select month , it should insert the same 
value in field2

 

request your support

Ex: 

field1 .value('JAN')

 

field2 is excluded from froms.py

want the value to be inserted in field2  from field 1 in db

 

update / delete /insert functions are fine, no issues  but field2 is not 
getting value from field 1

 

Thank You

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61f44948.1c69fb81.9ac1a.ad93%40mx.google.com
 
<https://groups.google.com/d/msgid/django-users/61f44948.1c69fb81.9ac1a.ad93%40mx.google.com?utm_medium=email&utm_source=footer>
 .

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKGT9mwczssa%3D%3DP%3Dxp8rC2cbwkQx%3DoRb%2BRXHGc_NfQOd05824Q%40mail.gmail.com
 
<https://groups.google.com/d/msgid/django-users/CAKGT9mwczssa%3D%3DP%3Dxp8rC2cbwkQx%3DoRb%2BRXHGc_NfQOd05824Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
 .

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61f48e29.1c69fb81.37f23.2cf1%40mx.google.com.

Reply via email to