Nope that's completely fine. I copied that example from the tests earlier on 
which interpolates connection.vendor into a string. If you know which backend 
you're modifying (and you should) then Func.as_vendor = .. Would be preferred. 

> On 19 Jun 2014, at 21:04, Shai Berger <s...@platonix.com> wrote:
> 
> Hi,
> 
> A minor style point:
> 
> On Thursday 19 June 2014 02:56:10 Josh Smeaton wrote:
>> 
>> class Lower(Func):
>>    function = 'LOWER'
>> 
>> [...]
>> 
>> def mongo_lower(self, compiler, connection):
>>    self.function = '$toLower'
>>    return self.as_sql(compiler, connection)
>> 
>> setattr(Lower, 'as_mongo', mongo_lower)
> I would spell this as
> 
> Lower.as_mongo = mongo_lower
> 
> Is there a reason I'm missing not to do so?
> 
> Thanks,
>    Shai.
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Django developers" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/django-developers/HggiPzwkono/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/201406191404.32091.shai%40platonix.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/61CA02CC-2444-4B66-9C68-48E9A7FFDBCF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to