Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
Ah, yes, it looks like aioredis requires at least 3.5.2. I will update the channels_redis readme to make this clear. On Fri, Feb 2, 2018 at 11:44 PM, Ahmed Magdy wrote: > v3.5.1:37a07cee5969 > > On Saturday, February 3, 2018 at 9:41:38 AM UTC+2, Andrew Godwin wrote: >> >>

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Ahmed Magdy
v3.5.1:37a07cee5969 On Saturday, February 3, 2018 at 9:41:38 AM UTC+2, Andrew Godwin wrote: > > That looks like a problem with the version of Python you are running - > what version is it? > > Andrew > > On Fri, Feb 2, 2018 at 11:36 PM, Ahmed Magdy > wrote: > >> Since you

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
That looks like a problem with the version of Python you are running - what version is it? Andrew On Fri, Feb 2, 2018 at 11:36 PM, Ahmed Magdy wrote: > Since you closed the issue, I'm posting here. > Ok, so I've updated asgiref package to 2.1.1 and now getting different

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Ahmed Magdy
Since you closed the issue, I'm posting here. Ok, so I've updated asgiref package to 2.1.1 and now getting different exception. [2018/02/03 09:29:23] WebSocket HANDSHAKING /sessions/ [127.0.0.1:13235] > ERROR:root:Exception inside application: '_WindowsSelectorEventLoop' > object has no

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
Yup, that looks like a genuine bug, I have opened a GitHub issue to track it: https://github.com/django/channels/issues/848 Andrew On Fri, Feb 2, 2018 at 10:35 PM, Ahmed Magdy wrote: > I even made sure to read the docs multiple times before posting. :/ > > I've been

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Ahmed Magdy
I even made sure to read the docs multiple times before posting. :/ I've been reading about Redis, and since I got windows OS, I installed the port for Windows based redis , tested the server and client they are working ok

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Web Architect
Hi Furbee, Thanks for your response. With my experience I have always noticed that a query within query kills the mysql and Mysqld CPU usage hits the ceiling. I would still check your alternate. I have mentioned the size of A and B in response to Vijay's reply. On Saturday, February 3,

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Web Architect
Hi Vijay, Thanks for your response. In my scenario, there is also another model with manytomany relation with A: class C(models.Model): a = manytomany('A', related_name='cs', through='D') so, for around 25K records in A, 45K records in D and 18K records in B, following query takes more

Re: Customizable Invoice

2018-02-02 Thread Rakhee Menon
Oops!!I am sorry !! I got your question wrong.Yes I do have some knowledge about django. Just wanted to know whether its possible and any solution if u could suggest. Anways Thanks a lot :) On Friday, February 2, 2018 at 3:20:21 PM UTC+5:30, Andy wrote: > > Well since your answer is no, you

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
The docs do mention this in a big callout at the top of the Channel Layers page :) http://channels.readthedocs.io/en/latest/topics/channel_layers.html Andrew On Fri, Feb 2, 2018 at 8:52 PM, Ahmed Magdy wrote: > Aha thanks for making it clear, I will read more about redis

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Ahmed Magdy
Aha thanks for making it clear, I will read more about redis then. Shouldn't the docs mention that though? On Saturday, February 3, 2018 at 6:47:47 AM UTC+2, Andrew Godwin wrote: > > No, there is no in-memory channel layer any more, only Redis is available > at the moment. You must put

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
No, there is no in-memory channel layer any more, only Redis is available at the moment. You must put something into the settings in order to make it function. Andrew On Fri, Feb 2, 2018 at 8:42 PM, Ahmed Magdy wrote: > I thought it uses in memory channel layer by

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Ahmed Magdy
I thought it uses in memory channel layer by default if it's empty? I didn't try setting a value, because only redis was available in v2.0.0 and I don't like using stuff I don't understand. On Saturday, February 3, 2018 at 6:08:02 AM UTC+2, Andrew Godwin wrote: > > It needs to contain a value

Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Andy
No you didn’t miss anything. He did not understand your question. But like I said before you can always build your own filter. Your problem is highly custom to your DB and model relations. You can’t expect any framework to already have a matching component for that. In my 9 years of Django

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
It needs to contain a value to work - what value were you trying that was not empty? Andrew On Fri, Feb 2, 2018 at 8:04 PM, Ahmed Magdy wrote: > I tried not having CHANNEL_LAYERS or setting it to {} > same exception > > On Saturday, February 3, 2018 at 3:36:43 AM UTC+2,

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Ahmed Magdy
I tried not having CHANNEL_LAYERS or setting it to {} same exception On Saturday, February 3, 2018 at 3:36:43 AM UTC+2, Andrew Godwin wrote: > > Do you have a CHANNEL_LAYERS setting in your settings file? If so, what is > it set to? > > Andrew > > On Fri, Feb 2, 2018 at 5:17 PM, Ahmed Magdy

Re: Django

2018-02-02 Thread Jung Hoon Park
Thank you very much Rocha, I come to understand that import statement checks the module and its submodule specified in from clause. 2018년 2월 2일 금요일 오후 1시 28분 57초 UTC+9, sacrac 님의 말: > > path is call from django.urls > https://github.com/django/django/blob/master/django/urls/conf.py > you need

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
Do you have a CHANNEL_LAYERS setting in your settings file? If so, what is it set to? Andrew On Fri, Feb 2, 2018 at 5:17 PM, Ahmed Magdy wrote: > That's what I did after reading the documentation here's how my channels > files look like > > # settings.py > # ... >

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Ahmed Magdy
That's what I did after reading the documentation here's how my channels files look like # settings.py # ... ASGI_APPLICATION = 'djangoChannels.routing.application' # ... # routing.py from django.conf.urls import url from channels.routing import ProtocolTypeRouter, URLRouter from channels.auth

Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Paul Tiplady
I've used that in a few admin pages, as far a I understand it just restricts the allowed values for a model's foreignkey field when editing a model instance. I don't see any way to use that to change how the `list_filter` functions -- am I missing something? Thanks, Paul On Fri, Feb 2, 2018 at

Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Mike Dewhirst
On 3/02/2018 5:23 AM, Paul Tiplady wrote: Currently it's simple to configure a filter on a foreign key in the admin: `list_filter = ['theforeignkeyfield']` However in practice this is barely usable in most cases that I've encountered, since the admin uses RelatedFieldListFilter, which

Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Paul Tiplady
That's a pretty inflexible solution though; what if I want to filter on multiple foreign keys, e.g. Tenant=Foo(id=1), Customer=Bar(id=200)? On Fri, Feb 2, 2018 at 12:57 PM, Andy wrote: > You should rather use search_fields instead of filtering together with the > sorting

App 'polls' could not be found. Is it in INSTALLED_APPS?

2018-02-02 Thread Peter Mkwawa
I am having trouble in the makemigrations part -- 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,

Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Andy
You should rather use search_fields instead of filtering together with the sorting ability of the admin. Thats much more suited for a scenario like described above. The filter is for status fields or something with just a few different entries, otherwise build your own filter to filter for some

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Furbee
There are a couple options you could try to see which is the best fit for your data. With DEBUG=True in settings.py you can check the actual queries and process time. It depends on the sizes of A and B. Another query you can run is: A.objects.exclude(id__in=B.objects.all().values_list('a_id',

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Vijay Khemlani
"with large of records in A and B, the above takes lot of time" How long? At first glance it doesn't look like a complex query or something particularly inefficient for a DB. On Fri, Feb 2, 2018 at 11:31 AM, Andy wrote: > not that i know of > > > Am Freitag, 2. Februar

Re: Newbie - Microservice in Django - Best place to start learning

2018-02-02 Thread Paul Tiplady
Assuming you're trying to build a REST API and not a HTML website, you should look at http://www.django-rest-framework.org/ as it provides a lot of djangonic convenience methods for building REST APIs with the Django ORM. On Thursday, February 1, 2018 at 9:16:47 AM UTC-8, pratibha sharma wrote:

In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Paul Tiplady
Currently it's simple to configure a filter on a foreign key in the admin: `list_filter = ['theforeignkeyfield']` However in practice this is barely usable in most cases that I've encountered, since the admin uses RelatedFieldListFilter, which fetches the full list of objects from the DB and

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
Hi Ahmed, In the new release channel layers are optional - if you don't configure them they will indeed come through as None. The settings format changed slightly too - you can read more here: http://channels.readthedocs.io/en/latest/topics/channel_layers.html Andrew On Fri, Feb 2, 2018 at 3:31

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Andy
not that i know of Am Freitag, 2. Februar 2018 15:28:26 UTC+1 schrieb Web Architect: > > Hi Andy, > > Thanks for your response. I was pondering on option a before posting this > query thinking there could be better ways in django/SQL to handle this. But > now I would probably go with a. > >

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Web Architect
Hi Andy, Thanks for your response. I was pondering on option a before posting this query thinking there could be better ways in django/SQL to handle this. But now I would probably go with a. Thanks. On Friday, February 2, 2018 at 7:50:53 PM UTC+5:30, Andy wrote: > > a) Maybe its an option to

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Andy
a) Maybe its an option to put the foreign key to the other model? This way you dont need to make a join to find out if there is a relation. b) Save the existing ralation status to model A c) cache the A.objects.filter(bs__isnull=False) query But apart from that i fear you cannot do much more,

Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Web Architect
Hi, I am trying to optimise Django queries on my ecommerce website. One of the fundamental query is where I have no clue how to make efficient. It could be trivial and probably been known long time back. But I am new to Django and would appreciate any help. This is primarily for one to many or

Django Channels 2.0.0 groups

2018-02-02 Thread Ahmed Magdy
I'm relatively new to channels and was using Channels v1.x.x groups easily, but after v2.0.0 update and reading the documentation # This example uses WebSocket consumer, which is synchronous, and so # needs the async channel layer functions to be converted. from asgiref.sync import AsyncToSync

Re: Customizable Invoice

2018-02-02 Thread Andy
Well since your answer is no, you should take you time and learn Python/Dajngo before asking anyone in here to basically write that invoice app for you. :) Basically Django can do what you are asking for, but i'd recommend you to use it only as a backend for this highly UI focused problem.

Re: Customizable Invoice

2018-02-02 Thread Jani Tiainen
Hi, This actually isn't much of doing with Django. It's more just about your UI to be able to do things you want to. Django definitely can record your invoice format and you can even print it out in a format stored in Django. But what you need is tool for UI (in browser) which allows you

Re: Customizable Invoice

2018-02-02 Thread Rakhee Menon
No...I wanted to know if i could do it using django and if yes...how to do it?? -- 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

Re: Customizable Invoice

2018-02-02 Thread Rakhee Menon
Hi, I am going to use django. Regards, Rakhee -- 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

Re: Customizable Invoice

2018-02-02 Thread Andy
Do you have any idea in any programming language you know how to do what you are asking for? -- 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