Re : Need help in django database related

2021-10-13 Thread Avi shah
I want to build an platform where admin can add events and I want end users
to register for that event , so how do I save the data/registration of the
user for that particular event , how can i create dynamic tables like 1
table for 1 event or is there some other logic behind it?

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALa7AFPNK_KTJvDERYXmi_RG9_xq58EjiBAH7PsOcL0gCFHDYg%40mail.gmail.com.


Re: Child data table in Django

2021-10-13 Thread Eugene TUYIZERE
Dear Sebstian,

Thank you for your email. Frankly speaking I do not have the code for that
kind of table. I used to use the usual datatable but now I want to
implement the one with child row as the image I attached previously.

Regards,

On Wed, 13 Oct 2021 at 15:30, Sebastian Jung 
wrote:

> Hello eugene,
>
> You have implement also jquery >= 3.5.1 and datatablea.min.js
>
> Please show us your html code and javascript code that open row when you
> click on this item...
>
> Regards
>
> Eugene TUYIZERE  schrieb am Mi., 13. Okt. 2021,
> 14:05:
>
>> Dear All,
>>
>> Kindly assist me to have a tutorial or code to make this kind of table in
>> django. I failed to do this from the datatable .net tutorial.
>> [image: image.png]
>>
>> regards,
>>
>> --
>> * Eugene*
>>
>> --
>> 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/CABxpZHuY_zoSvcwQL79UPts6g%3DmJRD%3DO_B%2Bc5%3DvinOtPKNLFLw%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/CAKGT9mxwBrDNvAGSqXkoXhKkvaNowY45LiCWgLzWxgiytJPZbw%40mail.gmail.com
> 
> .
>


-- 
*TUYIZERE Eugene*



*Msc Degree in Mathematical Science*

*African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
Garden-Lime, Cameroon*

Bsc in Computer Science

*UR-Nyagatare Campus*

Email: eugene.tuyiz...@aims-cameroon.org
   eugenetuyiz...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

-- 
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/CABxpZHupRhi6z8KH%2BrT5hapSfa3hRSV%2B7NsTf7cA9KAkb4TmiA%40mail.gmail.com.


Re: Child data table in Django

2021-10-13 Thread Sebastian Jung
Hello eugene,

You have implement also jquery >= 3.5.1 and datatablea.min.js

Please show us your html code and javascript code that open row when you
click on this item...

Regards

Eugene TUYIZERE  schrieb am Mi., 13. Okt. 2021,
14:05:

> Dear All,
>
> Kindly assist me to have a tutorial or code to make this kind of table in
> django. I failed to do this from the datatable .net tutorial.
> [image: image.png]
>
> regards,
>
> --
> * Eugene*
>
> --
> 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/CABxpZHuY_zoSvcwQL79UPts6g%3DmJRD%3DO_B%2Bc5%3DvinOtPKNLFLw%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/CAKGT9mxwBrDNvAGSqXkoXhKkvaNowY45LiCWgLzWxgiytJPZbw%40mail.gmail.com.


Re: Child data table in Django

2021-10-13 Thread Eugene TUYIZERE
I want to make the same as this below but using django. That is what I
want. The data are in one table but display shows child table

https://datatables.net/examples/server_side/row_details.html


any one help please

On Wed, 13 Oct 2021 at 14:28, Ammar Mohammed  wrote:

> Hello Dear
>
> You can use djangos prefetch_related in the docs :
>
> prefetch_related()¶
> 
> prefetch_related(**lookups*)¶
> 
>
> Returns a QuerySet that will automatically retrieve, in a single batch,
> related objects for each of the specified lookups.
>
> This has a similar purpose to select_related, in that both are designed
> to stop the deluge of database queries that is caused by accessing related
> objects, but the strategy is quite different.
>
> select_related works by creating an SQL join and including the fields of
> the related object in the SELECT statement. For this reason,
> select_related gets the related objects in the same database query.
> However, to avoid the much larger result set that would result from joining
> across a ‘many’ relationship, select_related is limited to single-valued
> relationships - foreign key and one-to-one.
>
> prefetch_related, on the other hand, does a separate lookup for each
> relationship, and does the ‘joining’ in Python. This allows it to prefetch
> many-to-many and many-to-one objects, which cannot be done using
> select_related, in addition to the foreign key and one-to-one
> relationships that are supported by select_related. It also supports
> prefetching of GenericRelation
> 
>  and GenericForeignKey
> ,
> however, it must be restricted to a homogeneous set of results. For
> example, prefetching objects referenced by a GenericForeignKey is only
> supported if the query is restricted to one ContentType.
>
> For example, suppose you have these models:
>
> from django.db import models
> class Topping(models.Model):
> name = models.CharField(max_length=30)
> class Pizza(models.Model):
> name = models.CharField(max_length=50)
> toppings = models.ManyToManyField(Topping)
>
> def __str__(self):  # __unicode__ on Python 2
> return "%s (%s)" % (
> self.name,
> ", ".join(topping.name for topping in self.toppings.all()),
> )
>
> and run:
>
> >>> Pizza.objects.all()
>
> Url : https://docs.djangoproject.com/en/1.10/ref/models/querysets/
>
>
> On Wed, 13 Oct 2021, 2:06 PM Eugene TUYIZERE, 
> wrote:
>
>> Dear All,
>>
>> Kindly assist me to have a tutorial or code to make this kind of table in
>> django. I failed to do this from the datatable .net tutorial.
>> [image: image.png]
>>
>> regards,
>>
>> --
>> * Eugene*
>>
>> --
>> 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/CABxpZHuY_zoSvcwQL79UPts6g%3DmJRD%3DO_B%2Bc5%3DvinOtPKNLFLw%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/CAHs1H7vL%3Dzawt%2BqPiBU1qrZojSLpdjZuMWYiWT3jic-8dZfTEw%40mail.gmail.com
> 
> .
>


-- 
*TUYIZERE Eugene*



*Msc Degree in Mathematical Science*

*African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
Garden-Lime, Cameroon*

Bsc in Computer Science

*UR-Nyagatare Campus*

Email: eugene.tuyiz...@aims-cameroon.org
   eugenetuyiz...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

-- 
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/CABxpZHtwZg6JVSMa4Gbc%2B2cb1obRNs5mxsX95qghNAsM23%2B%2BUg%40mail.gmail.com.


Re: Child data table in Django

2021-10-13 Thread Ammar Mohammed
Hello Dear

You can use djangos prefetch_related in the docs :

prefetch_related()¶

prefetch_related(**lookups*)¶


Returns a QuerySet that will automatically retrieve, in a single batch,
related objects for each of the specified lookups.

This has a similar purpose to select_related, in that both are designed to
stop the deluge of database queries that is caused by accessing related
objects, but the strategy is quite different.

select_related works by creating an SQL join and including the fields of
the related object in the SELECT statement. For this reason,
select_related gets
the related objects in the same database query. However, to avoid the much
larger result set that would result from joining across a ‘many’
relationship, select_related is limited to single-valued relationships -
foreign key and one-to-one.

prefetch_related, on the other hand, does a separate lookup for each
relationship, and does the ‘joining’ in Python. This allows it to prefetch
many-to-many and many-to-one objects, which cannot be done using
select_related, in addition to the foreign key and one-to-one relationships
that are supported by select_related. It also supports prefetching of
GenericRelation

 and GenericForeignKey
,
however, it must be restricted to a homogeneous set of results. For
example, prefetching objects referenced by a GenericForeignKey is only
supported if the query is restricted to one ContentType.

For example, suppose you have these models:

from django.db import models
class Topping(models.Model):
name = models.CharField(max_length=30)
class Pizza(models.Model):
name = models.CharField(max_length=50)
toppings = models.ManyToManyField(Topping)

def __str__(self):  # __unicode__ on Python 2
return "%s (%s)" % (
self.name,
", ".join(topping.name for topping in self.toppings.all()),
)

and run:

>>> Pizza.objects.all()

Url : https://docs.djangoproject.com/en/1.10/ref/models/querysets/


On Wed, 13 Oct 2021, 2:06 PM Eugene TUYIZERE, 
wrote:

> Dear All,
>
> Kindly assist me to have a tutorial or code to make this kind of table in
> django. I failed to do this from the datatable .net tutorial.
> [image: image.png]
>
> regards,
>
> --
> * Eugene*
>
> --
> 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/CABxpZHuY_zoSvcwQL79UPts6g%3DmJRD%3DO_B%2Bc5%3DvinOtPKNLFLw%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/CAHs1H7vL%3Dzawt%2BqPiBU1qrZojSLpdjZuMWYiWT3jic-8dZfTEw%40mail.gmail.com.


OnlineBook - High Performance Django

2021-10-13 Thread Brent Clark

Good day Guys

I got this off news.python.sc, and thought I would share in case anyone 
misses it.


https://lincolnloop.com/high-performance-django/index.html

Definitely some tidbits of information, esp to areas of securing and 
performance improving.


HTH
Regards
Brent


--
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/351773ca-3b6a-bc04-00e4-76092eb2e841%40gmail.com.


Child data table in Django

2021-10-13 Thread Eugene TUYIZERE
Dear All,

Kindly assist me to have a tutorial or code to make this kind of table in
django. I failed to do this from the datatable .net tutorial.
[image: image.png]

regards,

-- 
* Eugene*

-- 
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/CABxpZHuY_zoSvcwQL79UPts6g%3DmJRD%3DO_B%2Bc5%3DvinOtPKNLFLw%40mail.gmail.com.