Re: django-filters many to many

2021-02-15 Thread Sebastian Jung
Yeah but this doesn't work. I describe IT in my Last Post why Regards MOHIT DILIP MAKWANA schrieb am Mo., 15. Feb. 2021, 15:22: > Hey, > You can add a dunder method for your "Productinterests" model to > return the name of the object instead of the name of model. > It involves the use

Re: django-filters many to many

2021-02-15 Thread MOHIT DILIP MAKWANA
Hey, You can add a dunder method for your "Productinterests" model to return the name of the object instead of the name of model. It involves the use of '__str__()' method. You can implement it in the following way: class Productinterests(models.Model): id =

Re: django-filters many to many

2021-02-15 Thread Sebastian Jung
-name-you-want >> >> On Mon, 15 Feb, 2021, 10:00 am Agni Venus, wrote: >> >>> Add >>> Def __str__(self): >>> return self.what-ever-name-you-want >>> >>> On Sun, 14 Feb, 2021, 9:00 pm sebasti...@gmail.com, < >>> sebastian.j

Re: django-filters many to many

2021-02-15 Thread Sebastian Jung
t;>> >>> On Sun, 14 Feb, 2021, 9:00 pm sebasti...@gmail.com, < >>> sebastian.ju...@gmail.com> wrote: >>> >>>> Hello, >>>> >>>> i have installed per pip django-filters. >>>> >>>> Models.py: >>>> >>&

Re: django-filters many to many

2021-02-14 Thread Agni Venus
0:00 am Agni Venus, wrote: > >> Add >> Def __str__(self): >> return self.what-ever-name-you-want >> >> On Sun, 14 Feb, 2021, 9:00 pm sebasti...@gmail.com, < >> sebastian.ju...@gmail.com> wrote: >> >>> Hello, >>> >>> i have

Re: django-filters many to many

2021-02-14 Thread Agni Venus
u...@gmail.com> wrote: > >> Hello, >> >> i have installed per pip django-filters. >> >> Models.py: >> >> class Productinterests(models.Model): >> id = models.AutoField(primary_key=True) >> name = models.CharField(max_leng

Re: django-filters many to many

2021-02-14 Thread Agni Venus
Add Def __str__(self): return self.what-ever-name-you-want On Sun, 14 Feb, 2021, 9:00 pm sebasti...@gmail.com, < sebastian.ju...@gmail.com> wrote: > Hello, > > i have installed per pip django-filters. > > Models.py: > > class Productinterests(models.Model):

django-filters many to many

2021-02-14 Thread sebasti...@gmail.com
Hello, i have installed per pip django-filters. Models.py: class Productinterests(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=255, default="", blank=False, null= False) class Address(models.Model): produc

RE: Compiling django filters into a variable and executing it at runtime?

2018-08-15 Thread Matthew Pava
s.com [mailto:django-users@googlegroups.com] On Behalf Of Joel Sent: Wednesday, August 15, 2018 9:29 AM To: django-users@googlegroups.com Subject: Compiling django filters into a variable and executing it at runtime? I'm trying to write a search function for my model. A customer has the foll

Compiling django filters into a variable and executing it at runtime?

2018-08-15 Thread Joel
I'm trying to write a search function for my model. A customer has the following fields: cstid = models.AutoField(primary_key=True, unique=True) name = models.CharField(max_length=35) age=models.IntegerField() gender = models.CharField(max_length=10, default='') mobile =

Re: Django filters with Foreign Key

2016-09-19 Thread A.Khan
> > Happy to see we are in same boat. It did work with like: > def prod_sold(self): prod = self.get_prod().filter(seller__user=self.account.user) sold = Order.objects.filter(id=products) return sold But it only shows number of products sold. I couldn't make it happen.

Re: Django filters with Foreign Key

2016-09-19 Thread Shamaila Moazzam
Hi , i am having the same problem ..with my sellers App . can you share your solutionthat how you filter regards On Monday, September 19, 2016 at 5:27:31 PM UTC+5, A.Khan wrote: > > I just got it done. > > Thanks. > > On Mon, Sep 19, 2016 at 4:19 AM, Ali khan

Re: Django filters with Foreign Key

2016-09-19 Thread Ali khan
I just got it done. Thanks. On Mon, Sep 19, 2016 at 4:19 AM, Ali khan wrote: > I've tried many ways but it ends with the same error that says: > > Cannot query "alikhan": Must be "User" instance. > > Where alikhan is admin user I've created with createsuperuser. > >

Re: Django filters with Foreign Key

2016-09-19 Thread Ali khan
I've tried many ways but it ends with the same error that says: Cannot query "alikhan": Must be "User" instance. Where alikhan is admin user I've created with createsuperuser. Hate to bother you again but please advise. Regards, Ali On Sun, Sep 18, 2016 at 11:08 PM, James Schneider

Re: Django filters with Foreign Key

2016-09-19 Thread James Schneider
On Sep 18, 2016 10:22 PM, "Ali khan" wrote: > > Thank you for your kind response James. > > I must be doing something wrong but I thought that importing different models and assigning them with variable may had help me to filter it out. I will try your suggestion first

Re: Django filters with Foreign Key

2016-09-18 Thread Ali khan
Thank you for your kind response James. I must be doing something wrong but I thought that importing different models and assigning them with variable may had help me to filter it out. I will try your suggestion first to save your valued time and then will post with result. Let me add a field

Re: Django filters with Foreign Key

2016-09-18 Thread James Schneider
On Sep 18, 2016 4:01 AM, "Ali khan" wrote: > > I have two different apps and applying filters by ForeignKey and as newbie I am not able to understand how it works. > > My Order App: > ORDER_STATUS_CHOICES={ > ('created','Created'), >

Django filters with Foreign Key

2016-09-18 Thread Ali khan
I have two different apps and applying filters by ForeignKey and as newbie I am not able to understand how it works. My Order App: ORDER_STATUS_CHOICES={ ('created','Created'), ('paid','Paid'), } class Order(models.Model): status =

Django - filters

2012-01-28 Thread Sandeep kaur
Hello all, In my django application, all the data of different clients are entered. Sometimes data of even same client is also entered. Now what I require is to get all the data of the client when it asked for. The views I used is:

Re: django filters

2010-05-20 Thread Peter Bengtsson
The way you set up the ordering (e.g. 'change_date') just change that to '-change_date'. A minus in front of the ordering keyword reverses the sort order. On 20 May, 06:32, rahul jain wrote: > Hi, > > In my model, I have set up one filter which helps in filtering out the

django filters

2010-05-19 Thread rahul jain
Hi, In my model, I have set up one filter which helps in filtering out the results on admin Panel. The way its works now that its displays the old objects first and then the most recent ones. Is it possible to make it other way around ?. Let me know. --RJ -- You received this message because

Re: Could django filters be used in its models instead of templates ?

2006-01-10 Thread Qi Cheng
sorry. I have got it resolved. Seems i was in a totally wrong direction. please ignore this question.

Could django filters be used in its models instead of templates ?

2006-01-10 Thread Qi Cheng
Hi I am implementing such a function. I have a textarea that will be inputted many characters, when they are showed in page, they will be displayed in one line, very ugly.So I want to change the '\n' in the texts to ''. I know this can be implemented by wysiwig editor(e.g. tiny_mce), and I