Re: error on django admin

2011-05-09 Thread Karen Tracey
On Mon, May 9, 2011 at 3:32 AM, chhots wrote: > class Like(models.Model): > smartbuy = models.ForeignKey(SmartBuy) > User = models.ForeignKey(User) > def __unicode__(self): > return self.smartbuy or “Smartbuy #%d” % self.smartbuy > What are you trying to do here? If you are trying to do somethin

Re: error on django admin

2011-05-09 Thread Oleg Lomaka
Try to add __unicode__ method to your SmartBuy model that returns string. On Mon, May 9, 2011 at 10:32 AM, chhots wrote: > class Like(models.Model): > smartbuy = models.ForeignKey(SmartBuy) > User = models.ForeignKey(User) > def __unicode__(self): > return self.smartbuy or “Smartbuy #%d” % self.

error on django admin

2011-05-09 Thread chhots
class Like(models.Model): smartbuy = models.ForeignKey(SmartBuy) User = models.ForeignKey(User) def __unicode__(self): return self.smartbuy or “Smartbuy #%d” % self.smartbuy i have this model which is both fields are foreign key from other table and when i tri to add some in this model through djna

Re: how to raise an error on django admin

2011-01-04 Thread Daniel Carvalho
I think the way to do is: from django.contrib import messages then somewhere... messages.add_message(request, messages.ERROR, "your error message") The message will be displayed in the top of the next admin page On 01/03/2011 09:40 PM, Acorn wrote: > I'd like to know this too. > > On 3 Janua

Re: how to raise an error on django admin

2011-01-03 Thread Acorn
I'd like to know this too. On 3 January 2011 17:25, rahul jain wrote: > Hi, > > How to display an error in django admin (the error should be displayed in > red just like in forms) > > Something of this form > > http://groups.google.com/group/django-users/browse_thread/thread/68d4ea1915654134/447e

how to raise an error on django admin

2011-01-03 Thread rahul jain
Hi, How to display an error in django admin (the error should be displayed in red just like in forms) Something of this form http://groups.google.com/group/django-users/browse_thread/thread/68d4ea1915654134/447ef8473cf86672 Thanks. Rahul -- You received this message because you are subscribe