Re: Using Django Channels to subscribe to a Redis channel

2018-11-22 Thread Nasir Sh
Aalto Arba wrote: > > try with self.channel_layer.group_send ? > > On Wed, 21 Nov 2018 at 19:44, Nasir Sh > > wrote: > >> Thanks Andrew this helps me as well. There is a missing piece I don't >> understand yet. In my management command, then I probably wi

Re: Using Django Channels to subscribe to a Redis channel

2018-11-21 Thread Nasir Sh
Thanks Andrew this helps me as well. There is a missing piece I don't understand yet. In my management command, then I probably will have to use `async_to_sync(channel_layer.group_send)` to send the message to consumers (right?). The only problem is that whenever I use async_to_sync it creates

Re: How to fix i18n fallback , from variant xx-YY to xx and from xx to en the translatino is not available.

2017-05-08 Thread Abdullah Sh.
Well as far I can test, Django i18n does supports fall-back 'xx-YY' to 'xx' then to default ('en' in my case) but only for 'Accept-Language' user agent header. It does not do same for URL language switch. Here is the solution I could come up with: from django.views.generic import

How to fix i18n fallback , from variant xx-YY to xx and from xx to en the translatino is not available.

2017-05-06 Thread Abdullah Sh.
Well, official documentation says clearly it should fall-back (ex: fr-fr to fr then to en) but my case raises 404 error. Source: https://django.readthedocs.io/en/1.5.x/topics/i18n/translation.html If a base language is available but the sublanguage specified is not, > Django uses the base

Django: Relation does not exist in Postgresql

2015-09-03 Thread Alex Sh.
W henever I run python manage.py of my project in ubuntu, it throws the following error. I am stuck. I cannot find solution, please help. /home/vagrant/.envs/mycars/lib/python3.4/site-packages/djorm_pgfulltext/models.py:323: RemovedInDjango18Warning: `SearchManagerMixIn.get_query_set`

Re: GeometryField.geography = True Syntax Help GIS Model

2014-04-08 Thread si . at . sh
Hope you got to the bottom of this, and yes I thought your original question was pretty direct. If you haven't worked it out already and are still trying to get this working (or if anyone else stumbles across this), then essentially yes you would pass in geography=True, just as you would

Re: "Beginning Geo Django: Rich Gis Web Applications With Python" Where can I get the book?

2014-03-16 Thread ruomu sh
Yes I understand. But I could not figure out how can I get it here at Nepal. I will buy it. I find different price listed on internet. Some site say it is out of stock. Is it published only limited copies? On Friday, February 21, 2014 6:47:20 PM UTC+5:45, Tom Evans wrote: > > On Fri, Feb 21,

Re: Please find it in your hearts to expose filter_or_exclude at a global level.

2011-04-11 Thread sh...@bogomip.com
understanding how it is made available in the first place. - Shane On Apr 11, 11:04 am, Jacob Kaplan-Moss <ja...@jacobian.org> wrote: > On Mon, Apr 11, 2011 at 11:23 AM, sh...@bogomip.com <spence...@gmail.com> > wrote: > > IMHO (which is very H) _filter_or_exclude sh

Please find it in your hearts to expose filter_or_exclude at a global level.

2011-04-11 Thread sh...@bogomip.com
I often have to filter or exclude based on a search boolean. Writing duplicate code for both queries or selecting which of the two functions using my own function feels horribly repetitive since a function doing exactly that exists in the base model query manager. IMHO (which is very H)

Re: New ManyToManyField Approach

2010-11-23 Thread sh...@bogomip.com
On Nov 23, 6:42 pm, Christophe Pettus <x...@thebuild.com> wrote: > On Nov 23, 2010, at 5:40 PM, sh...@bogomip.com wrote: > > > Without test data I'm not sure where the trade offs are with the > > following.  However it should improve the ability to look up items > >

New ManyToManyField Approach

2010-11-23 Thread sh...@bogomip.com
I've recently started using the following approach when attempting to reduce the size of ManyToManyField type reference tables. Currently I'm working on implementing this in a limited fashion into my own work. I would like to share what I'm working on with you all and see if it's worth a

A IntegerField can't have value=0 when blank=False???

2007-08-19 Thread SH
I wanted to ask here before I post a ticket. If you have an integer field in your model, it can't equal zero if the field is required (blank=False) Here's the code out of Field.validate_full that causes this: if not self.blank and not field_data: return [_('This field is required.')] Am I

Re: How does the database modeling work?

2007-08-07 Thread SH
> My question is how does django get the field names for the DB. Does it > do some type of reflection on People class? Yep - It just looks for Field instances in the model's class dict. You can do this pretty easily using a python metaclas

Re: remember me feature

2007-08-02 Thread SH
> is implementing remember me feature for login is as simple as changing > the cookies settings in the settings.py? is manipulating of setting.py > allowed in views? > I just incorporated the DualSessionMiddleware into my project. It does what it says, and didn't break any of my other code.

Re: Django equivalent of ROR flash

2007-08-02 Thread SH
I haven't tried it myself, but check out: http://www.djangosnippets.org/snippets/331/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django - technology or magic?

2007-07-24 Thread SH
That's one of the reasons I like django better than rails - Because there's so little magic. It's all pretty straightforward. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: removal of Django

2007-07-20 Thread SH
This is awesome. Did it uninstall your rails stack too? UR pwnd On Jul 20, 3:57 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi all.Django auto loaded onto my computer from( I believe) a Harry > Potter web site.I want to remove it,as it is messing up one of the web > sites that I

Re: Authentication for application with subdomains

2007-07-20 Thread SH
On Jul 20, 1:06 am, David Marko <[EMAIL PROTECTED]> wrote: > > One possible solution would be to append the domain name to the > > username before authentication. The user types in 'bob', then the > > system munges it to 'bob.sub.domain.com' before doing the validation. > > ### this approach

Re: Authentication for application with subdomains

2007-07-19 Thread SH
it to 'bob.sub.domain.com' before doing the validation. Anyone know of a less hackish answer? I know we can create custom authentication backends, but I don't see another way to let users have the same username across different subdomains. SH --~--~-~--~~~---~--~~ You received