I thought select_related works for only FK/M2M and prefetch_related works
for only reverse relations, doesn't it?
Saygılarımla,
Sencer HAMARAT
On Fri, May 29, 2020 at 7:32 AM אורי wrote:
> Hi Soumen,
>
> Sometimes prefetch_related is much faster and more efficient than
> select_related.
Hi Uri,
Never expose whole settings anytime. settings is always includes sensitive
data. At least DB access key and Django's secret value.
This attitude is highly vulnerable. Anyone could access those sensitive
data via response headers if you don't play settings without cautious.
Saygılarımla,
Se
I believe, the method "get_query*set*" name is explains what you want to
know.
If you filter or fetch every thing with django query, it returns queryset.
The .get() query on the other hand, returns a single object.
Saygılarımla,
Sencer HAMARAT
On Fri, May 29, 2020 at 4:43 AM django-newbie
wro
Hello Derek,
Is it possible to retrieve the id of the previous recording from this
function? If possible I could increment it to get the id of the current
recording.
Anselme S.
Le ven. 29 mai 2020 à 06:08, Derek a écrit :
> The suggested code will not work because, at this point, the "id" has no
Hi Meera,
You have only one record because of you are using .latest() method in the
query.
If you want to last 3 or 4 object ordered by descending date, you should
write queryset like this:
notifications = Notification.objects.all().order_by('-date')[0:x] # The
'x' could be 3 or 4 by your choic
Thank you.
אורי
u...@speedy.net
On Fri, May 29, 2020 at 12:56 PM Sencer Hamarat
wrote:
> Hi Uri,
> Never expose whole settings anytime. settings is always includes sensitive
> data. At least DB access key and Django's secret value.
> This attitude is highly vulnerable. Anyone could access those
They both work for both.
אורי
u...@speedy.net
On Fri, May 29, 2020 at 12:47 PM Sencer Hamarat
wrote:
> I thought select_related works for only FK/M2M and prefetch_related works
> for only reverse relations, doesn't it?
>
> Saygılarımla,
> Sencer HAMARAT
>
>
>
> On Fri, May 29, 2020 at 7:32 AM
Django users,
Which way is preferred to customize Django built-in views such as LoginView:
- Define a line in urls.py:
path(route='login/', view=views.django_auth_views.LoginView.as_view(
template_name='accounts/login.html', authentication_form=forms.LoginForm,
extra_context=None, redirect_authe
Hi John
I agree with Kasper.
Regards,
Akshat
On Thursday, 28 May 2020 01:31:03 UTC+5:30, Kasper Laudrup wrote:
>
> Hi John,
>
> On 27/05/2020 19.06, John McClain wrote:
> > Hello All,
> >
> > Can anyone provide a method to split payments via paypal. I basically
> > want to earn a commissi
I would choose the second option and define a LoginView subclass in the
views.py module.
The outcome is exactly the same, but I'd prefer to have my views all
defined in views.py file.
Adding too much logic in the urls.py module IMHO is not a good idea and it
makes the view less extendable in the
Ohk, I got it now..
Thanks for clarifying this.
My further doubts in continuation of this are.
1. For confirmation, ModelName.objects.all() calls get_queryset() method,
while ModelName.objects.get calls get() method internally.
2. In above code to override default serialize method of BasicUserU
I would not assume what "previous" means. Rather use post_save to get the
actual ID of the current recording.
On Friday, 29 May 2020 12:43:19 UTC+2, Anselme SERI wrote:
>
> Hello Derek,
> Is it possible to retrieve the id of the previous recording from this
> function? If possible I could increm
Hi,
whenever I'm trying to filter as per your convention I'm getting some error
like FieldError:
*Eg.* *profile =
Profile.objects.filter(education__profile__institute_name="IIT KGP")*
of course, I'm getting this error because Profile is working here as a
Foreign Key, in Education table.
actually
Hi,
Yeah, but whenever I'm trying to iterate a loop on all these qs. I'm
getting an *error too many sql variables.* I know I'm doing something
wrong,but I'm not able to find the error.
Thank you for your response and time.
Regards,
Soumen
On Fri, May 29, 2020 at 5:49 PM אורי wrote:
> Th
Thank You, for your guidance.I think I'm very close to this problem.
Thank you once again.
On Fri, May 29, 2020 at 9:56 AM אורי wrote:
> Hi Soumen,
>
> You can filter on another table by using __, for
> example:
>
> User.objects.filter(profile__profiles__institute_name="Example")
>
> Or:
>
Hello, good day everyone on the forum, I am new to the topic, but I have the
basic notions and it makes me quite interesting, I would ask you to recommend
books, documents, to understand the topic further, excellent day, greetings.
--
You received this message because you are subscribed to
ea i checked the permission_classes variable, i got attached the error
message displayed
On Thu, May 21, 2020 at 4:34 PM Chetan Ganji wrote:
> If you post the error, someone can help you better.
>
> Did you look into authentication_classes variable of the endpoint ???
>
> Regards,
> Chetan Ganji
I was working on a comment section for post and was getting an
AttributeError when I return return '{}-{}'.format(self.post.title,
str(self.user.username)) in the comment model
I am trying to link users and posts to the comment I am getting the same
error
Here is the Models.py
class Comment
>
> Hello Iain,
>
I am also working on Mosh's python tutorial and I'm having the same
problems that you expressed in this chat. Did you delete the migrations
through pycharm or through your computer to make it work?
Thanks
--
You received this message because you are subscribed to the Google
Thank you So much for helping me out!!
Thanks a lot
Meera Gangani
On Fri, May 29, 2020 at 5:08 PM Sencer Hamarat
wrote:
> Hi Meera,
>
> You have only one record because of you are using .latest() method in the
> query.
>
> If you want to last 3 or 4 object ordered by descending date, you should
I Want to implement Mark all a read in notification!!
So What should i do!!
Can you explain me a little bit of this!
On Sat, May 30, 2020 at 8:46 AM meera gangani
wrote:
> Thank you So much for helping me out!!
> Thanks a lot
>
> Meera Gangani
>
> On Fri, May 29, 2020 at 5:08 PM Sencer Hamarat
Thank you.
אורי
u...@speedy.net
On Fri, May 29, 2020 at 3:57 PM Augusto Destrero
wrote:
> I would choose the second option and define a LoginView subclass in the
> views.py module.
> The outcome is exactly the same, but I'd prefer to have my views all
> defined in views.py file.
> Adding too mu
22 matches
Mail list logo