Re: Trigger receiver signal on Proxy model

2017-05-12 Thread Constantine Covtushenko
Hi, It is supposed to run 'index_elastic' when you save 'Item' entity. And to run 'new_index_elastic' when you save 'Newmodel' entity. May be the reason why you do not see proper logs that in your code all operations with entity are done based on 'Item' class? Hope that helps. Regards, Constanti

Re: View Function Signature?

2017-05-12 Thread Constantine Covtushenko
Hi Nick, As for me it is responsibility of the developer to define view function. There is only one mandatory argument 'request'. All other are based on the logic of view function and url patterns. Say for view function that operates with entity might be natural to add 'id' as a second parameter.

Re: Need help with deployment

2017-05-12 Thread mohammed ferozkhan
Hi Problem will solved?? If no ping me on what'sapp +91 8686962047 -- 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. T

Re: Subquery filter (__in) causing invalid SQL

2017-05-12 Thread Simon Charette
Murray, Glad I could help! I recently contributed changes to this part of the ORM hence why it rang a bell when I saw your issue. Subquery was introduced in 1.11 so it's still a new feature that hasn't been battle tested yet. Please file a new ticket on Trac [0]. Cheers, Simon [0] https://c

Re: Subquery filter (__in) causing invalid SQL

2017-05-12 Thread Murray Christopherson
I am assuming you are a regular to the Django community - possibly even a moderator? Despite the workaround (thanks again), would you recommend I add this to the issue tracker as a bug? On Friday, 12 May 2017 13:25:55 UTC-4, Simon Charette wrote: > > Hi Murray, > > That looks like a bug to me. >

Re: Subquery filter (__in) causing invalid SQL

2017-05-12 Thread Murray Christopherson
Unfortunately, my checks come up fruitless. Simon's code seems to work in both 1.10 and 1.11. I would have swore I tried this code during my attempts, but I will trust that I am mistaken, and thank you Simon for pointing me in the right direction. On Friday, 12 May 2017 13:39:37 UTC-4, Murray C

Re: Subquery filter (__in) causing invalid SQL

2017-05-12 Thread Murray Christopherson
Huh, yes, that seems to work now. I'm going to confirm real quick, but I don't think that worked back in v1.10. I was attempting to do the subquery-ing in v1.10 for the past few days, because it was slow to do it as 2 separate queries, and then just happened upon the release notes of v1.11 and

Re: Model representation with FK, exceeding queries

2017-05-12 Thread Simon Charette
Hello Cleiton, I'm a bit surprised only two queries were executed on 1.10 as each time a city string representation is created the associated state will need to be fetched as well. Were you using any form of select_related()/prefetch_related() to make sure this wasn't an issue? It's possible that

Re: Subquery filter (__in) causing invalid SQL

2017-05-12 Thread Simon Charette
Hi Murray, That looks like a bug to me. Do you get similar results if you don't use the Subquery expression and pass the query directly instead? Something along the lines of Permit.objects.filter(~Q(uuid__in=activeSuspensionPermitUuidsQuery.values('permit__uuid')) Simon Le vendredi 12 mai 201

Model representation with FK, exceeding queries

2017-05-12 Thread Cleiton Lima
I do not know if it is a bug or has already been commented # models.py class State(models.Model): name = models.CharField(_('name'), max_length=60) class Meta: verbose_name = _('state') verbose_name_plural = _('states') def __str__(self): return self.name c

Re: Displaying Categories / Subcategories (Tango with Django Example)

2017-05-12 Thread jorrit787
Both, actually. The OP is looping through his cats and pages querysets multiple times unnecessarily. That can get very inefficient as those database tables get bigger. On Friday, May 12, 2017 at 6:04:01 PM UTC+2, sacrac wrote: > > {% regroup %} is elegantly or more optimized??? > > On Fri, May

Re: Displaying Categories / Subcategories (Tango with Django Example)

2017-05-12 Thread carlos
{% regroup %} is elegantly or more optimized??? On Fri, May 12, 2017 at 5:05 AM, wrote: > You can look into the {% regroup %} template tag. It will do what you are > trying to do more elegantly. > > > > On Wednesday, May 10, 2017 at 7:40:26 PM UTC+2, Michael Smith wrote: >> >> I'm following the

empty form during tests with selenium

2017-05-12 Thread wkg21
Hello, I'm trying to test select form with selenium but getting empty selection form. I have set up fixtures in test case and I see that test db is populated but generated form is empty. What might be a problem? What am i doing wrong that form can't get data drom test db? thanks Woj django=1.11

Subquery filter (__in) causing invalid SQL

2017-05-12 Thread Murray Christopherson
Not sure if I should raise this as a bug, because I'm not sure if I'm using it correctly. I am writing code conceptually similar to the code I am actually working with, I hope it suffices. Within my app, there is the concept of permits and suspensions: class Permit(models.Model): class Meta:

Re: django registration issues

2017-05-12 Thread Antonis Christofides
Hi, not what you ask, but it isn't a good idea to have a copy of django-registration (or any third-party package) in your project directory; instead, just "pip install django-registration-redux". Regards, A. Antonis Christofides http://djangodeployment.com On 2017-05-12 17:09, farah_chaa...@h

django registration issues

2017-05-12 Thread farah_chaaban
I am trying to download registration application from github but i have some problems: - git clone https://github.com/macropin/django-registration.git - python install setup.py - i copied the registration folder to my project folder Than : *Url.py* from django.conf.urls import * from django.c

Re: View Function Signature?

2017-05-12 Thread Nick Gilmour
Thanks for the link. I understand these examples but still I would like to see how a view function is defined. I also would like to see it in PyCharm. When I click on a view function in PyCharm I only see: def myview_function(request) Inferred type: (request: Any) -> HttpResponse I would expect

Re: View Function Signature?

2017-05-12 Thread Constantine Covtushenko
Hi, Please check that link of documentation. For me it was very helpful to understand all pieces of Request/Response cycle. Regards, Constantine C. On Fri, May 12, 2017 at 4:05 PM, nickeforos wrote: > I'm

View Function Signature?

2017-05-12 Thread nickeforos
I'm following the django tutorials and documentaion as well as the django book. In https://docs.djangoproject.com/en/1.11/topics/http/views/ there is this view function: def current_datetime(request): now = datetime.datetime.now() html = "It is now %s." % now return HttpResponse(html)

Re: Displaying Categories / Subcategories (Tango with Django Example)

2017-05-12 Thread jorrit787
You can look into the {% regroup %} template tag. It will do what you are trying to do more elegantly. On Wednesday, May 10, 2017 at 7:40:26 PM UTC+2, Michael Smith wrote: > > I'm following the latest Tango book and was experimenting with different > ways of looping through categories and subca

Re: Permissions for Anonymous Users in Django

2017-05-12 Thread Melvyn Sopacua
On Friday 12 May 2017 02:38:23 James Schneider wrote: > On May 12, 2017 12:32 AM, "Melvyn Sopacua" > wrote: > On Thursday 11 May 2017 21:59:48 Constantine Covtushenko wrote: > > Let us check terms: > > > > Anonymous User - is one that is not authenticated. It refers to > > > > scenarios when som

Re: Localization with thousand separator makes foreign key id invalid in forms

2017-05-12 Thread Alti
Hello Simon, I confirm, updated the project to 1.11.1 and it is solved. Thanks for taking the time to check. Thomas. On Thursday, May 11, 2017 at 8:30:52 PM UTC+4, Simon Charette wrote: > > Hello Thomas, > > Probably caused by #28075 [0], fixed in 1.11.1. > > Cheers, > Simon > > [0] https://cod

Re: Permissions for Anonymous Users in Django

2017-05-12 Thread James Schneider
On May 11, 2017 12:44 PM, "Uzair Tariq" wrote: Thanks man! So basically my example and deduction of the sentence was right about the anonymous and inactive authenticated users where i stated that the anonymous may be able to view the public profile but if it's an inactive authenticated user becau

Re: Permissions for Anonymous Users in Django

2017-05-12 Thread James Schneider
On May 12, 2017 12:32 AM, "Melvyn Sopacua" wrote: On Thursday 11 May 2017 21:59:48 Constantine Covtushenko wrote: > Let us check terms: > Anonymous User - is one that is not authenticated. It refers to > scenarios when someone opens site pages. Even robots can be such > users. > > Inactive

Re: Permissions for Anonymous Users in Django

2017-05-12 Thread Melvyn Sopacua
On Thursday 11 May 2017 21:59:48 Constantine Covtushenko wrote: > Let us check terms: > Anonymous User - is one that is not authenticated. It refers to > scenarios when someone opens site pages. Even robots can be such > users. > > Inactive Authenticated User - is one that successfully logged in.