I created a table view based on django that loads the whole data and is now having performance issues

2018-09-08 Thread brajesh kumar
I created a table view based on django that loads the whole data and is now 
having performance issues..

Any suggestion would be appreciated.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a1438251-50b1-4a61-9413-142f5fe084ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I am looking for a view that talks to two models and same two models managed in admin page / html

2018-09-19 Thread brajesh kumar
Reference : https://www.youtube.com/watch?v=6lafzyjiqgQ


-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16720022-577c-4c83-8ba7-25b392971b0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-filter over models

2018-09-19 Thread brajesh kumar
I think this answers my question , trying to implement it.

On Wednesday, September 19, 2018 at 4:45:02 AM UTC+5:30, Mateusz wrote:
>
> In that answer I assume Jobs are connected anyhow with Persons with a 
> ForeignKey field like so:
>
> *File /appname/models.py:*
>
> from django.db import models
>
>
> class Job(models.Model):
> name = models.CharField(max_length=100)
>
> def __str__(self):
> return self.name
>
>
> class Person(models.Model):
> name = models.CharField(max_length=100)
> surname = models.CharField(max_length=100)
>
> job = models.ForeignKey(Job, on_delete=models.SET_NULL, null=True, 
> default=None)
>
> def __str__(self):
> return self.name + ' ' + self.surname
>
>
> *File /appname/views.py:*
>
> from django.shortcuts import render
> from django.views.generic.list import ListView
>
> from appname.models import Job, Person
>
>
> class JobsWithPersonsView(ListView):
> queryset = Job.objects.all()
> template_name = 'jobs_list.html'
>
>
>
> *File /appname/templates/jobs_list.html:*
>
> 
> 
> 
> 
> Jobs
> 
> 
> {% for job in object_list %}
> {{ job.name }}
> {% for person in job.person_set.all %}
> {{ person.name }} {{ person.surname }}
> {% empty %}
> Nobody works there.
> {% endfor %}
> {% empty %}
> No jobs.
> {% endfor %}
> 
> 
>
>
> And others you probably know how to deal with...
> File /urls.py:
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('appname/', include('appname.urls'))
> ]
>
>
> *File /appname/urls.py:*
>
> from django.urls import path
> from appname import views
>
> urlpatterns = [
> path('jobslist/', views.JobsWithPersonsView.as_view(), name='jobslist')
> ]
>
>
> *BTW: *Your model names should be in singular form, if you want to be 
> able to use plural forms in some cases, use verbose_name_plural (docs 
> 
> ).
>
> W dniu czwartek, 13 września 2018 05:26:20 UTC+2 użytkownik René L. 
> Hechavarría napisał:
>>
>> Hello,
>>
>> I have a model, Jobs and Persons, Jobs are listed in ListView, i need to 
>> add a filter (django-filter), if i filter over field in Jobs all work good, 
>> but i need to filter also for Persons. this is and example
>>
>> @property
>> def get_persons(self):
>> return self.persons_all.all()
>>
>>
>> That allow to add persons to Jobs model in de html. How i filter over 
>> persons in Jobs view?
>>
>> Thanks in advance.
>>
>>
>>
>>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2b43517b-7c96-493d-aa5e-b4976283ce91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[no subject]

2018-12-04 Thread brajesh kumar
Hi,
I am looking to prep a web page based on django,  with some options on a
table like,  web table with link to each record.
In each record,  an option related to add, update,  delete, search
Could someone help.
Thanks.
Brajesh

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGrz2rizgb9OMOmwKnZjCYwWZN7Ndet%2BkbKx_Ugrey7ptf2U8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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.


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.