Application specific middleware support

2019-07-07 Thread Kapil Garg
Hi, I am working on one django project and recently i had the requirement for a middleware. But i don't want this middleware to hook to every url served by the whole project but instead, only to one of the apps. I tried to look on the internet but everywhere there are hacks to implement it but

Re: Proposal: make Model __unicode__() default to self.name

2017-04-02 Thread Kapil Garg
Ticket 27953 is regarding this proposal and the suggestion is about adding "pk" in Model string representation if it exists. On Thursday, 11 July 2013 09:16:25 UTC+5:30, Collin Anderson wrote: > > Hi All, > > Have you ever quickly set up a model, ra

Re: Proposal: make Model __unicode__() default to self.name

2017-04-03 Thread Kapil Garg
es sense to me. Maybe still keep the "Transaction object" part, and use > None if no pk. > > On Sun, Apr 2, 2017 at 11:09 AM, Kapil Garg > wrote: > >> Ticket 27953 <https://code.djangoproject.com/ticket/27953> is regarding >> this proposal and the suggestion

Re: Proposal: make Model __unicode__() default to self.name

2017-04-03 Thread Kapil Garg
April 2017 23:07:56 UTC+5:30, Collin Anderson wrote: > > I'd recommend not saying "unsaved". "new" if anything. UUID pk's may > default to generating a pk before save, so it might just be best to show > the actual current pk value > > On Mon, Apr 3, 2017

Re: Proposal: make Model __unicode__() default to self.name

2017-04-07 Thread Kapil Garg
obal lookups > cls = self.__class__ > > maybe you should change it to self.cls?? > Try to submit a PR to the open ticket. > > segunda-feira, 3 de Abril de 2017 às 21:07:47 UTC+1, Kapil Garg escreveu: > > So does this patch seem fine ? > > diff --git a/django/db/models/