Re: Re: Error with filter queryset

2020-02-09 Thread maninder singh Kumar
have you tried "OneToOneField" ?
I am wondering about a many to one field to User


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Mon, Feb 10, 2020 at 12:01 AM BRAJESH KUMAR 
wrote:

> I have a local host website working with some page showing few details of
> one of many products with a data associated for usage like zoom car rental.
>
>
>
> Facing issues while trying to add a counter and have it updated by day.
>
>
>
> Eg: if I have a product a available 10 units for next 10 days and it gets
> booked for one day 3 units, the counter should update.
>
>
>
> Need help for the same.
>
>
>
> Thanks,
>
> Brajesh
>
>
>
> Sent from Mail  for
> Windows 10
>
> --
> 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/5e404fcb.1c69fb81.c5c43.951d%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABOHK3QUBBah9f%2BoSRD2Ckw5J93EROExeyjjeweG3uQaQSVaGg%40mail.gmail.com.


Re: Regarding Summer internship opportunities

2020-02-09 Thread Karan Mittal
Here's my linkedin profile for your reference.
https://www.linkedin.com/in/karansmittal

On Mon, 10 Feb, 2020, 10:04 AM Karan Mittal, 
wrote:

> Hey Guys, If you are interested, then share your resume with me. I have a
> requirement for python developers and javascript developers.
> Regards,
> Karan Mittal
>
> On Mon, 10 Feb, 2020, 2:43 AM Anupriya Nishad, 
> wrote:
>
>> My name is Anupriya Nishad and I’m a third-year B.Tech student at the
>> Madan Mohan Malaviya University of Technology, Gorakhpur.
>> I am extremely interested in doing an internship in the following fields-
>> 1.Web Development using Django
>> 2. Machine Learning
>> 3.Python
>>
>> Please let me know if there is any internship opportunity.
>>
>> --
>> 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/CAGcPrqSj4pg46b4VdHm7Lu7Z1gbQSNJ1G2q5R2B0kb3eSFcTMA%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO24gqy4a7kH0_VNVQfmXr%3D%3DrroMxBTz%2B4%3D1TAhGhcMibEzLUQ%40mail.gmail.com.


Re: Regarding Summer internship opportunities

2020-02-09 Thread Karan Mittal
Hey Guys, If you are interested, then share your resume with me. I have a
requirement for python developers and javascript developers.
Regards,
Karan Mittal

On Mon, 10 Feb, 2020, 2:43 AM Anupriya Nishad, 
wrote:

> My name is Anupriya Nishad and I’m a third-year B.Tech student at the
> Madan Mohan Malaviya University of Technology, Gorakhpur.
> I am extremely interested in doing an internship in the following fields-
> 1.Web Development using Django
> 2. Machine Learning
> 3.Python
>
> Please let me know if there is any internship opportunity.
>
> --
> 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/CAGcPrqSj4pg46b4VdHm7Lu7Z1gbQSNJ1G2q5R2B0kb3eSFcTMA%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO24gqzGcO1ps3ZKasYs9VPfbOfAr0Ntyt_oSd8VgNHMesJUtA%40mail.gmail.com.


Re: Regarding Summer internship opportunities

2020-02-09 Thread Ankit Raj
My name is Ankit Raj and I'm also looking for internship opportunities
related to Data Science, Python, ML.
Please let me know if there is an opportunity for me.


On Mon, Feb 10, 2020 at 3:03 AM Arjun Baidya 
wrote:

> if you interested in data science then you can work with me in virtually.
> Thanks
>
> On Mon, Feb 10, 2020 at 3:13 AM Anupriya Nishad 
> wrote:
>
>> My name is Anupriya Nishad and I’m a third-year B.Tech student at the
>> Madan Mohan Malaviya University of Technology, Gorakhpur.
>> I am extremely interested in doing an internship in the following fields-
>> 1.Web Development using Django
>> 2. Machine Learning
>> 3.Python
>>
>> Please let me know if there is any internship opportunity.
>>
>> --
>> 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/CAGcPrqSj4pg46b4VdHm7Lu7Z1gbQSNJ1G2q5R2B0kb3eSFcTMA%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFH0OctorCTWMbptFtpBQpyM%2BsuuDZfNH4JpeVCc1dZ9fExUKg%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHBa-JoucmU4r%3DEQ66nZ9j12O_Uoa-LAD%2BqO8QwdX%2B8YZkTzng%40mail.gmail.com.


Re: Regarding Summer internship opportunities

2020-02-09 Thread Ab Sporting Club
Lage rho sister

On 10 Feb 2020 02:43, "Anupriya Nishad"  wrote:

> My name is Anupriya Nishad and I’m a third-year B.Tech student at the
> Madan Mohan Malaviya University of Technology, Gorakhpur.
> I am extremely interested in doing an internship in the following fields-
> 1.Web Development using Django
> 2. Machine Learning
> 3.Python
>
> Please let me know if there is any internship opportunity.
>
> --
> 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/CAGcPrqSj4pg46b4VdHm7Lu7Z1gbQS
> NJ1G2q5R2B0kb3eSFcTMA%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB5yYPy_N00hU%2BXkqT6FjaWNCQ_8Gmmduo0TtE-%3D8CNgYJL-%2Bg%40mail.gmail.com.


Re: Adding a verbose_name to id field

2020-02-09 Thread Jason
You just need to use AutoField 


-- 
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/3f0ecd5b-9493-47dd-bf85-382e87c3efd9%40googlegroups.com.


Re: Regarding Summer internship opportunities

2020-02-09 Thread Arjun Baidya
if you interested in data science then you can work with me in virtually.
Thanks

On Mon, Feb 10, 2020 at 3:13 AM Anupriya Nishad 
wrote:

> My name is Anupriya Nishad and I’m a third-year B.Tech student at the
> Madan Mohan Malaviya University of Technology, Gorakhpur.
> I am extremely interested in doing an internship in the following fields-
> 1.Web Development using Django
> 2. Machine Learning
> 3.Python
>
> Please let me know if there is any internship opportunity.
>
> --
> 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/CAGcPrqSj4pg46b4VdHm7Lu7Z1gbQSNJ1G2q5R2B0kb3eSFcTMA%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFH0OctorCTWMbptFtpBQpyM%2BsuuDZfNH4JpeVCc1dZ9fExUKg%40mail.gmail.com.


Regarding Summer internship opportunities

2020-02-09 Thread Anupriya Nishad
My name is Anupriya Nishad and I’m a third-year B.Tech student at the Madan
Mohan Malaviya University of Technology, Gorakhpur.
I am extremely interested in doing an internship in the following fields-
1.Web Development using Django
2. Machine Learning
3.Python

Please let me know if there is any internship opportunity.

-- 
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/CAGcPrqSj4pg46b4VdHm7Lu7Z1gbQSNJ1G2q5R2B0kb3eSFcTMA%40mail.gmail.com.


Re: Problem with Admin Page

2020-02-09 Thread Gil Obradors
Hi Alessandro, can you report python version and django version?

Missatge de Alessandro D' Oronzo  del dia dg., 9 de
febr. 2020 a les 19:38:

> Hi everyone,
> I have a problem with local web server and admin page.
> When I try to connect to admin page the web server of Django close without
> errors.
> Do you have any ideas?
>
> Thanks so much!
>
> --
> 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/DB0F065D-5D63-438D-B5AA-DBFB05B28A54%40gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTSN45%3DG2s6aE5%3Dk8KbDdOhERSvV_NsjddRzxq187BM1Hw%40mail.gmail.com.


I'm looking for job for intern position in Amsterdam

2020-02-09 Thread göktürk sığırtmaç
Hi everyone. I'm looking for job for intern position in Amsterdam. I'm 
living in İzmit/Kocaeli/Turkey. I'm student at Kocaeli University pursuing 
physics. I'm 20 years old. I will be in Amsterdam at summer vacation 
(July/August/September so approximately 75 days) for development my 
language skills and learning different things like culture etc. I develop 
web software from approximately 4 years. I use Python with Django from 1 
year while web software development. If you interesting me. You can send 
email to me.

Email: s.gokt...@outlook.com
Linkedin: https://www.linkedin.com/in/skyturk/
Github: https://github.com/skyturks 

-- 
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/1a0a49a8-fe41-49bc-9bd8-8665986d36be%40googlegroups.com.


to add counter to an object of a table

2020-02-09 Thread BRAJESH KUMAR
Hi ,I have a product details db class with few details for each object of that class, need help to add a counter. Thanks,Brajesh  Sent from Mail for Windows 10 



-- 
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/5e405315.1c69fb81.6e215.a4ec%40mx.google.com.


[Django] Error occured while saving a form created through model formset factory

2020-02-09 Thread Dilipkumar Noone
 I am a Django learner. 

1.I have a requirement to create the multiple forms in a single page for a 
model. 
2.So i created the formset using modelformset_factory. 
3.I have 2 models.
a)ModelRegister b)ModelGSPRequest. 4.ModelGSPRequest has a field named 
registered_model which is a foreignKey to ModelRegister. 5.But after i 
input all the fields for a modelformset and click on submit to save. I am 
facing below error with the foreign key field.

-- 
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/84953e1b-a2e0-490e-a646-2fade661e6de%40googlegroups.com.


Problem with Admin Page

2020-02-09 Thread Alessandro D' Oronzo
Hi everyone,
I have a problem with local web server and admin page.
When I try to connect to admin page the web server of Django close without 
errors.
Do you have any ideas?

Thanks so much!

-- 
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/DB0F065D-5D63-438D-B5AA-DBFB05B28A54%40gmail.com.


RE: Re: Error with filter queryset

2020-02-09 Thread BRAJESH KUMAR
I have a local host website working with some page showing few details of one of many products with a data associated for usage like zoom car rental. Facing issues while trying to add a counter and have it updated by day. Eg: if I have a product a available 10 units for next 10 days and it gets booked for one day 3 units, the counter should update. Need help for the same. Thanks,Brajesh Sent from Mail for Windows 10



-- 
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/5e404fcb.1c69fb81.c5c43.951d%40mx.google.com.


Re: Error with filter queryset

2020-02-09 Thread Chucky Mada Madamombe
Thanks Farai!

Regards

Chuck G. Madamombe
NAM: +264 81 842 1284
RSA: +27 78 208 7034
Twitter: @chuckygari
Skype: chuckygari
Facebook: Chucky Mada Madamombe
LinkedIn: Chucknorris Garikayi Madamombe

On Sun, 9 Feb 2020, 18:14 Farai M  wrote:

> The status is a foreign ID u can use choices if the status is not
> dynamically changed by the users . Otherwise you will need to pass the
> selected status from fronted or hardcode it.
>
> On Sun, Feb 9, 2020, 2:58 PM Chuck G. Madamombe 
> wrote:
>
>> Hello,
>>
>> I want to filter data in the database to retrieve only those tasks with
>> status='In progress'. I have used the filter queryset, but am getting an
>> error. Please help.
>>
>> *Here is my view (Filter tasks by their status):*
>>
>> def tasks_in_progress(request):
>> tasks = Task.objects.filter(Status='In progress')
>> context = {'tasks': tasks}
>> #return render(request,"todoapp/show_task.html",{'tasks':tasks})
>> return render(request,"todoapp/tasks_in_progress.html", context)
>>
>>
>>
>> *The model.py*
>>
>> class Task(models.Model):
>> #Task_Title = models.ForeignKey(ToDoList, on_delete=models.CASCADE)
>> Task_Title = models.CharField(max_length=500)
>> Task_Description = models.CharField(max_length=500)
>> Priority = models.ForeignKey(Task_Priority, on_delete=models.CASCADE)
>> Date_Created = models.DateTimeField(auto_now_add=True)
>> Completion_Date = models.DateTimeField()
>> Assigned_To = models.ForeignKey(User, blank=True, null=True, 
>> on_delete=models.SET_NULL)
>> Status = models.ForeignKey(Task_Status, on_delete=models.CASCADE)
>>
>> def __str__(self):
>> return self.Task_Description
>>
>> *The error am getting is:*
>>
>> ValueError at /todoapp/tasks_in_progress
>>
>> Field 'id' expected a number but got 'In progress'.
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/todoapp/tasks_in_progress
>> Django Version: 3.0.2
>> Exception Type: ValueError
>> Exception Value:
>>
>> Field 'id' expected a number but got 'In progress'.
>>
>> Exception Location: C:\Users\Chuck
>> Madamombe\Desktop\djangoPROJECTS\lib\site-packages\django\db\models\fields\__init__.py
>> in get_prep_value, line 1772
>> Python Executable: C:\Users\Chuck
>> Madamombe\Desktop\djangoPROJECTS\Scripts\python.exe
>> Python Version: 3.7.1
>> Python Path:
>>
>> ['C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
>>  'C:\\Users\\Chuck 
>> Madamombe\\Desktop\\djangoPROJECTS\\Scripts\\python37.zip',
>>  'C:\\Users\\Chuck '
>>  'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
>>  'C:\\Users\\Chuck '
>>  'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
>>  'C:\\Users\\Chuck Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32',
>>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
>>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages',
>>  'C:\\Users\\Chuck '
>>  
>> 'Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages\\setuptools-39.1.0-py3.7.egg']
>>
>> Server time: Sun, 9 Feb 2020 10:22:05 +0200
>>
>>
>> But if I just retrieve all the records in the database, without
>> filtering, its working without an error
>>
>>
>>
>> *My View to retrieve all the records in the database, without filtering.*
>>
>> def show_task(request):
>> tasks = Task.objects.all()
>> context = {'tasks': tasks}
>> #return render(request,"todoapp/show_task.html",{'tasks':tasks})
>> return render(request,"todoapp/show_task.html", context)
>>
>>
>> --
>> 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/a13041e8-1c37-4722-bf64-4faa75dd56ff%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMeub5MQYn2EmMESTzbYqvkzO%3D6Qa1Rd7%3Ds2Kg%3DS9eibjX7fTw%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: Error with filter queryset

2020-02-09 Thread Chucky Mada Madamombe
Antje,

Thanks very much for your help!

Regards

Chuck G. Madamombe
NAM: +264 81 842 1284
RSA: +27 78 208 7034
Twitter: @chuckygari
Skype: chuckygari
Facebook: Chucky Mada Madamombe
LinkedIn: Chucknorris Garikayi Madamombe

On Sun, 9 Feb 2020, 15:25 Antje Kazimiers  wrote:

> Hi Chuck,
>
> Status in your example is not a text field, but a Foreign Key, that means
> a reference to a record in another table Task_Status, you see that here:
>
> Status = models.ForeignKey(Task_Status, on_delete=models.CASCADE)
>
>
> You need to filter on the attribute within Task_Status, which has the
> value 'In progress', probably the 'name' attribute:
>
> tasks = Task.objects.filter(Status__name='In progress')
>
>
> The error says it expects an id, which is the primary key of the
> Task_Status record the Task record is referring to.
>
>
> Hope that helps,
> Antje
>
> On 2/9/20 3:31 AM, Chuck G. Madamombe wrote:
>
> Hello,
>
> I want to filter data in the database to retrieve only those tasks with
> status='In progress'. I have used the filter queryset, but am getting an
> error. Please help.
>
> *Here is my view (Filter tasks by their status):*
>
> def tasks_in_progress(request):
> tasks = Task.objects.filter(Status='In progress')
> context = {'tasks': tasks}
> #return render(request,"todoapp/show_task.html",{'tasks':tasks})
> return render(request,"todoapp/tasks_in_progress.html", context)
>
>
> *The model.py*
>
> class Task(models.Model):
> #Task_Title = models.ForeignKey(ToDoList, on_delete=models.CASCADE)
> Task_Title = models.CharField(max_length=500)
> Task_Description = models.CharField(max_length=500)
> Priority = models.ForeignKey(Task_Priority, on_delete=models.CASCADE)
> Date_Created = models.DateTimeField(auto_now_add=True)
> Completion_Date = models.DateTimeField()
> Assigned_To = models.ForeignKey(User, blank=True, null=True, 
> on_delete=models.SET_NULL)
> Status = models.ForeignKey(Task_Status, on_delete=models.CASCADE)
>
> def __str__(self):
> return self.Task_Description
>
> *The error am getting is:*
>
> ValueError at /todoapp/tasks_in_progress
>
> Field 'id' expected a number but got 'In progress'.
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/todoapp/tasks_in_progress
> Django Version: 3.0.2
> Exception Type: ValueError
> Exception Value:
>
> Field 'id' expected a number but got 'In progress'.
>
> Exception Location: C:\Users\Chuck
> Madamombe\Desktop\djangoPROJECTS\lib\site-packages\django\db\models\fields\__init__.py
> in get_prep_value, line 1772
> Python Executable: C:\Users\Chuck
> Madamombe\Desktop\djangoPROJECTS\Scripts\python.exe
> Python Version: 3.7.1
> Python Path:
>
> ['C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\Scripts\\python37.zip',
>  'C:\\Users\\Chuck '
>  'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
>  'C:\\Users\\Chuck '
>  'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
>  'C:\\Users\\Chuck Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages',
>  'C:\\Users\\Chuck '
>  
> 'Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages\\setuptools-39.1.0-py3.7.egg']
>
> Server time: Sun, 9 Feb 2020 10:22:05 +0200
>
>
> But if I just retrieve all the records in the database, without filtering,
> its working without an error
>
>
>
> *My View to retrieve all the records in the database, without filtering.*
>
> def show_task(request):
> tasks = Task.objects.all()
> context = {'tasks': tasks}
> #return render(request,"todoapp/show_task.html",{'tasks':tasks})
> return render(request,"todoapp/show_task.html", context)
>
>
> --
> 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/a13041e8-1c37-4722-bf64-4faa75dd56ff%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/03679dec-cbd3-0890-4a10-afdff2336734%40gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 

Re: Adding a verbose_name to id field

2020-02-09 Thread Bruckner de Villiers
Thank you Mike & Jason.

I agree - messing around with the id is not the brightest idea I've ever 
conceived.
However, the Django 3 documentation is somewhat mute on auto-incrementing, but 
I'll continue searching Stack & Mozilla.  Have a great evening (I am GMT+2).
Regards,

Bruckner de Villiers
083 625 1086

On 2020/02/09, 08:28, "Mike Dewhirst"  wrote:

On 9/02/2020 3:54 am, Bruckner de Villiers wrote:
>
> Mike,
>
> I tried id = model.AutoField(verbose_name=”Ticket #”).  Migrate didn’t 
> like it – can’t have duplicate primaries.  I suspect this is because 
> the Bug model already exists.
>
> What I am trying to achieve is an auto-increment field whereby every 
> time a user logs a bug/suggestion/comment it writes a unique ticket 
> number in the background, which is used as a reference for subsequent 
> actions like Fixed, Close, WiP, etc.  and as a ForeignKey in the 
> Comment model.   I couldn’t find anything meaningful for this 
> functionality and so thought that the ‘id’ is already fit for purpose, 
> but merely requires an explanatory field text.
>

I think Jason is correct. The id field belongs to the DBMS and 
theoretically should never carry any human or real world meaning.

You would be better having an auto-incrementing field called "ticket" or 
similar

If you really must use the id field you can supply the model with your 
own id field (that's covered somewhere in the docs) with whatever name 
suits.

Cheers

Mike



> Make sense?
>
> Bruckner de Villiers
>
> 083 625 1086
>
> *From: * on behalf of Mike Dewhirst 
> 
> *Reply to: *
> *Date: *Saturday, 08 February 2020 at 13:48
> *To: *
> *Subject: *RE: Adding a verbose_name to id field
>
> I imagine you need to specify the id field in your model and give it a 
> verbose name.
>
> This is an unusual requirement. Why do you want to do such a thing?
>
> Mike
>
>  Original message 
>
> From: Bruckner de Villiers 
>
> Date: 8/2/20 21:33 (GMT+10:00)
>
> To: django-users@googlegroups.com
>
> Subject: Adding a verbose_name to id field
>
> Using Sqlite3 & Django 3.0.2 - I have searched high and low, but can’t 
> find a way to add a verbose name to the id of a model.
>
> Anyone have ideas, please?
>
> Bruckner de Villiers
>
> +27 83 625 1086
>
> -- 
> 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/5e3e9fe6.1c69fb81.7cda5.a2fdSMTPIN_ADDED_MISSING%40gmr-mx.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+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> 
https://groups.google.com/d/msgid/django-users/CA217C44-C4FE-4CE8-8479-97B9F05939BE%40gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2ad77dc8-e743-8241-7531-378bb7f717af%40dewhirst.com.au.



-- 
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/7DF8F99B-92E1-4DFA-84A7-FD63ECCC06E6%40gmail.com.


Re: Error with filter queryset

2020-02-09 Thread Farai M
The status is a foreign ID u can use choices if the status is not
dynamically changed by the users . Otherwise you will need to pass the
selected status from fronted or hardcode it.

On Sun, Feb 9, 2020, 2:58 PM Chuck G. Madamombe 
wrote:

> Hello,
>
> I want to filter data in the database to retrieve only those tasks with
> status='In progress'. I have used the filter queryset, but am getting an
> error. Please help.
>
> *Here is my view (Filter tasks by their status):*
>
> def tasks_in_progress(request):
> tasks = Task.objects.filter(Status='In progress')
> context = {'tasks': tasks}
> #return render(request,"todoapp/show_task.html",{'tasks':tasks})
> return render(request,"todoapp/tasks_in_progress.html", context)
>
>
>
> *The model.py*
>
> class Task(models.Model):
> #Task_Title = models.ForeignKey(ToDoList, on_delete=models.CASCADE)
> Task_Title = models.CharField(max_length=500)
> Task_Description = models.CharField(max_length=500)
> Priority = models.ForeignKey(Task_Priority, on_delete=models.CASCADE)
> Date_Created = models.DateTimeField(auto_now_add=True)
> Completion_Date = models.DateTimeField()
> Assigned_To = models.ForeignKey(User, blank=True, null=True, 
> on_delete=models.SET_NULL)
> Status = models.ForeignKey(Task_Status, on_delete=models.CASCADE)
>
> def __str__(self):
> return self.Task_Description
>
> *The error am getting is:*
>
> ValueError at /todoapp/tasks_in_progress
>
> Field 'id' expected a number but got 'In progress'.
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/todoapp/tasks_in_progress
> Django Version: 3.0.2
> Exception Type: ValueError
> Exception Value:
>
> Field 'id' expected a number but got 'In progress'.
>
> Exception Location: C:\Users\Chuck
> Madamombe\Desktop\djangoPROJECTS\lib\site-packages\django\db\models\fields\__init__.py
> in get_prep_value, line 1772
> Python Executable: C:\Users\Chuck
> Madamombe\Desktop\djangoPROJECTS\Scripts\python.exe
> Python Version: 3.7.1
> Python Path:
>
> ['C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\Scripts\\python37.zip',
>  'C:\\Users\\Chuck '
>  'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
>  'C:\\Users\\Chuck '
>  'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
>  'C:\\Users\\Chuck Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages',
>  'C:\\Users\\Chuck '
>  
> 'Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages\\setuptools-39.1.0-py3.7.egg']
>
> Server time: Sun, 9 Feb 2020 10:22:05 +0200
>
>
> But if I just retrieve all the records in the database, without filtering,
> its working without an error
>
>
>
> *My View to retrieve all the records in the database, without filtering.*
>
> def show_task(request):
> tasks = Task.objects.all()
> context = {'tasks': tasks}
> #return render(request,"todoapp/show_task.html",{'tasks':tasks})
> return render(request,"todoapp/show_task.html", context)
>
>
> --
> 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/a13041e8-1c37-4722-bf64-4faa75dd56ff%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMeub5MQYn2EmMESTzbYqvkzO%3D6Qa1Rd7%3Ds2Kg%3DS9eibjX7fTw%40mail.gmail.com.


Re: Error with filter queryset

2020-02-09 Thread Antje Kazimiers
Hi Chuck,

Status in your example is not a text field, but a Foreign Key, that
means a reference to a record in another table Task_Status, you see that
here:

Status = models.ForeignKey(Task_Status, on_delete=models.CASCADE)

You need to filter on the attribute within Task_Status, which has the
value 'In progress', probably the 'name' attribute:

tasks = Task.objects.filter(Status__name='In progress')


The error says it expects an id, which is the primary key of the
Task_Status record the Task record is referring to.


Hope that helps,
Antje

On 2/9/20 3:31 AM, Chuck G. Madamombe wrote:
> Hello,
>
> I want to filter data in the database to retrieve only those tasks
> with status='In progress'. I have used the filter queryset, but am
> getting an error. Please help.
>
> *Here is my view (Filter tasks by their status):*
>
> def tasks_in_progress(request):
> tasks = Task.objects.filter(Status='In progress')
> context = {'tasks': tasks}
> #return render(request,"todoapp/show_task.html",{'tasks':tasks}) return 
> render(request,"todoapp/tasks_in_progress.html", context)
>
> *The model.py*
> class Task(models.Model):
> #Task_Title = models.ForeignKey(ToDoList, on_delete=models.CASCADE) 
> Task_Title = models.CharField(max_length=500)
> Task_Description = models.CharField(max_length=500)
> Priority = models.ForeignKey(Task_Priority, on_delete=models.CASCADE)
> Date_Created = models.DateTimeField(auto_now_add=True)
> Completion_Date = models.DateTimeField()
> Assigned_To = models.ForeignKey(User, blank=True, null=True, 
> on_delete=models.SET_NULL)
> Status = models.ForeignKey(Task_Status, on_delete=models.CASCADE)
>
> def __str__(self):
> return self.Task_Description
> *The error am getting is:*
>
>
>   ValueError at /todoapp/tasks_in_progress
>
> Field 'id' expected a number but got 'In progress'.
> Request Method:   GET
> Request URL:  http://127.0.0.1:8000/todoapp/tasks_in_progress
> Django Version:   3.0.2
> Exception Type:   ValueError
> Exception Value:  
> Field 'id' expected a number but got 'In progress'.
> Exception Location:   C:\Users\Chuck
> Madamombe\Desktop\djangoPROJECTS\lib\site-packages\django\db\models\fields\__init__.py
> in get_prep_value, line 1772
> Python Executable:C:\Users\Chuck
> Madamombe\Desktop\djangoPROJECTS\Scripts\python.exe
> Python Version:   3.7.1
> Python Path:  
> ['C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\Scripts\\python37.zip',
>  'C:\\Users\\Chuck '
>  'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
>  'C:\\Users\\Chuck '
>  'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
>  'C:\\Users\\Chuck Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
>  'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages',
>  'C:\\Users\\Chuck '
>  
> 'Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages\\setuptools-39.1.0-py3.7.egg']
> Server time:  Sun, 9 Feb 2020 10:22:05 +0200
>
>
> But if I just retrieve all the records in the database, without
> filtering, its working without an error
>
>
>
> *My View to retrieve all the records in the database, without filtering.*
>
> def show_task(request):
> tasks = Task.objects.all()
> context = {'tasks': tasks}
> #return render(request,"todoapp/show_task.html",{'tasks':tasks}) return 
> render(request,"todoapp/show_task.html", context)
>
> -- 
> 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/a13041e8-1c37-4722-bf64-4faa75dd56ff%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/03679dec-cbd3-0890-4a10-afdff2336734%40gmail.com.


Error with filter queryset

2020-02-09 Thread Chuck G. Madamombe
Hello,

I want to filter data in the database to retrieve only those tasks with 
status='In progress'. I have used the filter queryset, but am getting an 
error. Please help.

*Here is my view (Filter tasks by their status):*

def tasks_in_progress(request):
tasks = Task.objects.filter(Status='In progress')
context = {'tasks': tasks}
#return render(request,"todoapp/show_task.html",{'tasks':tasks})
return render(request,"todoapp/tasks_in_progress.html", context)



*The model.py*

class Task(models.Model):
#Task_Title = models.ForeignKey(ToDoList, on_delete=models.CASCADE)
Task_Title = models.CharField(max_length=500)
Task_Description = models.CharField(max_length=500)
Priority = models.ForeignKey(Task_Priority, on_delete=models.CASCADE)
Date_Created = models.DateTimeField(auto_now_add=True)
Completion_Date = models.DateTimeField()
Assigned_To = models.ForeignKey(User, blank=True, null=True, 
on_delete=models.SET_NULL)
Status = models.ForeignKey(Task_Status, on_delete=models.CASCADE)

def __str__(self):
return self.Task_Description

*The error am getting is:*

ValueError at /todoapp/tasks_in_progress

Field 'id' expected a number but got 'In progress'.

Request Method: GET
Request URL: http://127.0.0.1:8000/todoapp/tasks_in_progress
Django Version: 3.0.2
Exception Type: ValueError
Exception Value: 

Field 'id' expected a number but got 'In progress'.

Exception Location: C:\Users\Chuck 
Madamombe\Desktop\djangoPROJECTS\lib\site-packages\django\db\models\fields\__init__.py
 
in get_prep_value, line 1772
Python Executable: C:\Users\Chuck 
Madamombe\Desktop\djangoPROJECTS\Scripts\python.exe
Python Version: 3.7.1
Python Path: 

['C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
 'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\Scripts\\python37.zip',
 'C:\\Users\\Chuck '
 'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
 'C:\\Users\\Chuck '
 'Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
 'C:\\Users\\Chuck Madamombe\\AppData\\Local\\Programs\\Python\\Python37-32',
 'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS',
 'C:\\Users\\Chuck Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages',
 'C:\\Users\\Chuck '
 
'Madamombe\\Desktop\\djangoPROJECTS\\lib\\site-packages\\setuptools-39.1.0-py3.7.egg']

Server time: Sun, 9 Feb 2020 10:22:05 +0200


But if I just retrieve all the records in the database, without filtering, 
its working without an error



*My View to retrieve all the records in the database, without filtering.*

def show_task(request):
tasks = Task.objects.all()
context = {'tasks': tasks}
#return render(request,"todoapp/show_task.html",{'tasks':tasks})
return render(request,"todoapp/show_task.html", context)


-- 
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/a13041e8-1c37-4722-bf64-4faa75dd56ff%40googlegroups.com.


Re: Contractions in Django 3.0 and Django 2.2

2020-02-09 Thread One Above All
I just replaced single quotes with that special character from response
string using replace method of string,

‪On Sat, Feb 8, 2020 at 8:41 PM ‫אורי‬‎  wrote:‬

> For example in this case:
>
> if (django.VERSION >= (3, 0)):
> ...
> else:
> ...
> אורי
> u...@speedy.net
>
>
> On Sat, Feb 8, 2020 at 3:48 PM One Above All <
> the.one.above.all.ti...@gmail.com> wrote:
>
>> i am working on a project which is adding support for Django 3.0. While
>> doing so, I came across ticket # 30400
>> https://code.djangoproject.com/ticket/30400 after which contractions
>> were rewritten. I am writing a test which should work with both Django 3.0
>> and 2.2. I have to assert error_messages
>> in django.contrib.auth.forms.SetPasswordForm like below
>>
>> self.assertIn("The two password fields didn’t match.",
>>> str(response.data['new_password2']))
>>
>>
>> How can I make this work in both versions of Django ?
>>
>> Thanks and Regards,
>> Gagan Deep
>>
>> --
>> 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/18f30e79-1c67-46b6-9482-d6f18a109887%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABD5YeECcxfDMWZ8tdwCUebQZz%2BWN--Os28Ce7pHg7SdCfrxNg%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOX69xrBBJft_JVJrTuxmvCARTBY8Hck98TaHt4iPbV9BbYtXA%40mail.gmail.com.