Re: Problem with models

2011-01-04 Thread Quetzacotl
I have added related_name to text1 and text2, so at least syncdb worked, but how can I now make this query. In manager: self.compare_set.filter(~Q(Q(compare__user=request.user)(Q(compare__text1__id=id)| Q(compare__text2__id=id.all() this doesn't work -- You received this message because

Problem with models

2011-01-04 Thread Quetzacotl
I have model of text, like that: class Text(models.Model): text = models.CharField() user = models.ForeignKey(User) #author And i need to compare two of texts, so i need table like this: class Compare(models.Model): text1 = models.ForeignKey(Text) text2 =

Returning value directly to another function

2010-12-09 Thread Quetzacotl
Hello, this is rather python problem, but maybe You can help. What i want to do is to return value in another function calling from other function. It doesnt mean i want this: def Func(): return 1 def Func2(): return Func() I want function Func to return 1 directly in Func2 as it is

Problem with redirect

2010-12-06 Thread Quetzacotl
Hello, i want to make function that wraps all things related to comments, so there should be part that gets comments from database and part that checks if comment was added. Then i can simply write just one line of code in view where i want comments. Problem is that after successful comment post,