Friday, January 28, 2022

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.resh@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+unsubscribe@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.

--
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+unsubscribe@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.

Re: Queryset in settings.py?

Hello Fabio,

i want that admin can make in database a entry to a field in my own settings model in field standardtemplatepath for example /newtemplate/ in my views.py there are exists a normal CBV Templateview with template_name = 'Testtemplate.html' and in settings.py i have a entry TEMPLATES = [
    {
       
        'DIRS': [
            location('templates'),
        ]}

Now when a endcustomer open this view then this view get template from /templates/newtemplate/Testtemplate.html. How can archive this?

Thank you very much

Am Sa., 29. Jan. 2022 um 00:14 Uhr schrieb Fabio C. Barrionuevo da Luz <bnafta@gmail.com>:
Hi Sebastian, I guess this is not possible.

But the real question is: why do you need a queryset to perform in the settings?

Perhaps if you explain what problem you want to solve, we can give you some options for other possible solutions.



Em sex., 28 de jan. de 2022 às 20:00, sebasti...@gmail.com <sebastian.jung2@gmail.com> escreveu:
Hello,

i want to import from a app models.py like this:

from app1.models import classname

then i get:

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

I want to get a queryset from app1.models.classname in settings.py. How is this possible?

Regards

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/18ef496c-c9a1-40df-b251-7ce2cc2dad82n%40googlegroups.com.


--
Fábio C. Barrionuevo da Luz
Palmas - Tocantins - Brasil - América do Sul


Blog colaborativo sobre Python e tecnologias Relacionadas, mantido totalmente no https://github.com/pythonclub/pythonclub.github.io .

Todos são livres para publicar. É só fazer fork, escrever sua postagem e mandar o pull-request. Leia mais sobre como publicar em README.md e contributing.md.
Regra básica de postagem:
"Você" acha interessante? É útil para "você"? Pode ser utilizado com Python ou é útil para quem usa Python? Está esperando o que? Publica logo, que estou louco para ler...

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPVjvMaWUcpwzWePO3XF%2BtqRP3e-YFH4iE9om8ig2hhTeazN%3DQ%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKGT9myirfhUNdMhThSMFwCVStWgpYyFfJUZb6uieD%3Dt%3DMipkA%40mail.gmail.com.

Re: Django users

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwT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3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 28/01/2022 21.26, Bernard Mallala wrote:
> I am thinking about skiing this afternoon
>

Sounds nice.

Enjoy and take care of yourself.

Kind regards,

Kasper Laudrup

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3bdf107b-5b29-6dfd-be2b-2ee743da75f2%40stacktrace.dk.

RE: copy value from field1 to field2

Hi

 

 

 

 

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Ammar Mohammed
Sent: 29 January 2022 03:42
To: 'Rahul Chauhan' via Django users
Subject: RE: copy value from field1 to field2

 

Hi 
Where is your forms.py ???

 

Ammar Mohammed
Tel: 0113075979

On 28 Jan 2022, 23:52 +0200, Feroz Ahmed <feroz.resh@gmail.com>, wrote:

Hi, Thanks for your support below are the views and models,   plz guide,   no errors but no success Views.py                       (cmonth is none value and excluded in form)  month is insertable from form templatedef insert(request):               form=StudentForm()               if request.method=="POST":                              form=StudentForm(request.POST)                              cmonth=request.GET.get('month')                              if form.is_valid():                                             form.save()                                             return redirect('/home1')               return render(request,'enroll/insert.html',{'form':form})------------------------------------------------------------------------------------------------------ Models.pyclass student(models.Model):  month = models.CharField(max_length=64, choices=COLOR_CHOICES, default='plz')  cmonth=models.CharField(max_length=64)  name= models.CharField(max_length=64)  salary= models.CharField(max_length=64)    #def student(month = request.GET['value'], cmonth=cmonth)  def fm(request):    fm =student.objects.create(month=request.GET['month'],cmonth=cmonth) ---------------------------------------------------------------------------------------------------------------------  ----------------------------------------------------------------------------------Here I want CMonth data from Month<image002.jpg>   From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Ammar MohammedSent: 29 January 2022 01:32To: 'Rahul Chauhan' via Django usersSubject: Re: copy value from field1 to field2 
Hello 
You can do it in your views.py 
#If request method is get you can use 
val2 = request.GET.get('val1') 
#if method is get you can use 
val2 = request.POST.get('val1')

#then you can use val2 to in sert it in the dB 
Model.objects.create(val1=request.GET['val1'], val2=val2) 

Regards 
 
Ammar Mohammed
Tel: 249113075979
On 28 Jan 2022, 21:52 +0200, Feroz Ahmed <feroz.resh@gmail.com>, wrote:

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+unsubscribe@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.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/51d615fc-43dd-4250-8d04-101c06ad3bf8%40Spark.
 --
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/61f4656c.1c69fb81.f300.d6d5%40mx.google.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a0b7392e-0477-4533-b026-5171879dbc93%40Spark.

RE: copy value from field1 to field2

Hi 
Where is your forms.py ???

Ammar Mohammed
Tel: 0113075979
On 28 Jan 2022, 23:52 +0200, Feroz Ahmed <feroz.resh@gmail.com>, wrote:
Hi, Thanks for your support below are the views and models,   plz guide,   no errors but no success Views.py                       (cmonth is none value and excluded in form)  month is insertable from form templatedef insert(request):               form=StudentForm()               if request.method=="POST":                              form=StudentForm(request.POST)                              cmonth=request.GET.get('month')                              if form.is_valid():                                             form.save()                                             return redirect('/home1')               return render(request,'enroll/insert.html',{'form':form})------------------------------------------------------------------------------------------------------ Models.pyclass student(models.Model):  month = models.CharField(max_length=64, choices=COLOR_CHOICES, default='plz')  cmonth=models.CharField(max_length=64)  name= models.CharField(max_length=64)  salary= models.CharField(max_length=64)    #def student(month = request.GET['value'], cmonth=cmonth)  def fm(request):    fm =student.objects.create(month=request.GET['month'],cmonth=cmonth) ---------------------------------------------------------------------------------------------------------------------  ----------------------------------------------------------------------------------Here I want CMonth data from Month<image002.jpg>   From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Ammar MohammedSent: 29 January 2022 01:32To: 'Rahul Chauhan' via Django usersSubject: Re: copy value from field1 to field2 
Hello 
You can do it in your views.py 
#If request method is get you can use 
val2 = request.GET.get('val1') 
#if method is get you can use 
val2 = request.POST.get('val1')

#then you can use val2 to in sert it in the dB 
Model.objects.create(val1=request.GET['val1'], val2=val2) 

Regards 
 
Ammar Mohammed
Tel: 249113075979
On 28 Jan 2022, 21:52 +0200, Feroz Ahmed <feroz.resh@gmail.com>, wrote:
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+unsubscribe@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.
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/51d615fc-43dd-4250-8d04-101c06ad3bf8%40Spark.
 --
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/61f4656c.1c69fb81.f300.d6d5%40mx.google.com.

RE: copy value from field1 to field2

Hi,

 

Thanks for your support below are the views and models,   plz guide,   no errors but no success

 

Views.py                       (cmonth is none value and excluded in form)  month is insertable from form template

def insert(request):

               form=StudentForm()

               if request.method=="POST":

                              form=StudentForm(request.POST)

                              cmonth=request.GET.get('month')

                              if form.is_valid():

                                             form.save()

                                             return redirect('/home1')

               return render(request,'enroll/insert.html',{'form':form})

------------------------------------------------------------------------------------------------------

 

Models.py

class student(models.Model):

  month = models.CharField(max_length=64, choices=COLOR_CHOICES, default='plz')

  cmonth=models.CharField(max_length=64)

  name= models.CharField(max_length=64)

  salary= models.CharField(max_length=64)

 

 

  #def student(month = request.GET['value'], cmonth=cmonth)

  def fm(request):

    fm =student.objects.create(month=request.GET['month'],cmonth=cmonth)

 

---------------------------------------------------------------------------------------------------------------------

 

 

----------------------------------------------------------------------------------

Here I want CMonth data from Month

 

 

 

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Ammar Mohammed
Sent: 29 January 2022 01:32
To: 'Rahul Chauhan' via Django users
Subject: Re: copy value from field1 to field2

 

Hello 
You can do it in your views.py 
#If request method is get you can use 
val2 = request.GET.get('val1') 
#if method is get you can use 
val2 = request.POST.get('val1')

#then you can use val2 to in sert it in the dB 
Model.objects.create(val1=request.GET['val1'], val2=val2) 

Regards 

 

Ammar Mohammed
Tel: 249113075979

On 28 Jan 2022, 21:52 +0200, Feroz Ahmed <feroz.resh@gmail.com>, wrote:

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+unsubscribe@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.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/51d615fc-43dd-4250-8d04-101c06ad3bf8%40Spark.

RE: copy value from field1 to field2

Hi,

 

Thanks for your support below are the views and models,   plz guide,   no errors but no success

 

Views.py                       (cmonth is none value and excluded in form)  month is insertable from form template

def insert(request):

               form=StudentForm()

               if request.method=="POST":

                              form=StudentForm(request.POST)

                              cmonth=request.GET.get('month')

                              if form.is_valid():

                                             form.save()

                                             return redirect('/home1')

               return render(request,'enroll/insert.html',{'form':form})

------------------------------------------------------------------------------------------------------

 

Models.py

class student(models.Model):

  month = models.CharField(max_length=64, choices=COLOR_CHOICES, default='plz')

  cmonth=models.CharField(max_length=64)

  name= models.CharField(max_length=64)

  salary= models.CharField(max_length=64)

 

 

  #def student(month = request.GET['value'], cmonth=cmonth)

  def fm(request):

    fm =student.objects.create(month=request.GET['month'],cmonth=cmonth)

 

---------------------------------------------------------------------------------------------------------------------

 

 

----------------------------------------------------------------------------------

Here I want CMonth data from Month

 

 

 

 

 

 

 

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Bernard Mallala
Sent: 29 January 2022 01:57
To: Django users
Subject: Re: Django users

 

I am thinking about skiing this afternoon

On Friday, January 28, 2022 at 12:18:08 PM UTC-7 Kasper Laudrup wrote:

On 28/01/2022 10.12, Anil Choudhari wrote:
> How to connect hive in Django ?
>

You can't. Better find something else to do.

Kind regards,

Kasper Laudrup

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6ccddcdb-67d7-4cd4-a20a-9d1f41a95194n%40googlegroups.com.

 

 

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Ammar Mohammed
Sent: 29 January 2022 01:32
To: 'Rahul Chauhan' via Django users
Subject: Re: copy value from field1 to field2

 

Hello 
You can do it in your views.py 
#If request method is get you can use 
val2 = request.GET.get('val1') 
#if method is get you can use 
val2 = request.POST.get('val1')

#then you can use val2 to in sert it in the dB 
Model.objects.create(val1=request.GET['val1'], val2=val2) 

Regards 

 

Ammar Mohammed
Tel: 249113075979

On 28 Jan 2022, 21:52 +0200, Feroz Ahmed <feroz.resh@gmail.com>, wrote:

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+unsubscribe@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.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/51d615fc-43dd-4250-8d04-101c06ad3bf8%40Spark.