Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread Tom Evans
On Tue, Aug 26, 2014 at 12:22 PM, Przemek Ciborowski wrote: > > So to be more clearly, let create new django project with one application for > example with name networks. > Add those lines to the networks/models.py: > > class Vlan(models.Model): > > name = models.CharField(max_length=30, nam

Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread Przemek Ciborowski
Thank you a lot! James & Tundebabzy - Thanks:) It was the mistake. Regards Przemek W dniu wtorek, 26 sierpnia 2014 15:38:33 UTC+2 użytkownik James Schneider napisał: > > Try changing the 'name' argument to 'verbose_name' like so: > > name = models.CharField(max_length=30, verbose_name='Vlan na

Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread Babatunde Akinyanmi
On 25 Aug 2014 23:32, "Babatunde Akinyanmi" wrote: > > Hi Przemek, > I'm not sure there's a name attribute for Field and its subclasses. > Does removing the name attribute work? > Oops. I meant argument not attribute > On 25 Aug 2014 22:19, "Przemek Ciborowski" wrote: >> >> Hello guys, >> >> I'

Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread Babatunde Akinyanmi
On 26 Aug 2014 14:38, "James Schneider" wrote: > > Try changing the 'name' argument to 'verbose_name' like so: > > name = models.CharField(max_length=30, verbose_name='Vlan name') > > I don't believe model fields accept 'name' as a keyword arg. This would also explain the slightly confusing error

Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread James Schneider
Try changing the 'name' argument to 'verbose_name' like so: name = models.CharField(max_length=30, verbose_name='Vlan name') I don't believe model fields accept 'name' as a keyword arg. This would also explain the slightly confusing error due to the overlap of 'name' appearing in multiple spots.

Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread Przemek Ciborowski
So to be more clearly, let create new django project with one application for example with name networks. Add those lines to the networks/models.py: class Vlan(models.Model): name = models.CharField(max_length=30, name='Vlan name') def __unicode__(self): return self.name add th

Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread Przemek Ciborowski
Hi, thanks for your reply. It didn't help, I also trid return unicode(self.name) Regards Przemek. W dniu wtorek, 26 sierpnia 2014 10:24:07 UTC+2 użytkownik monoBOT monoBOT napisał: > > Be sure to returm a unicode object like this: > > def __unicode__(self): > return u"%s" % self.na

Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread Przemek Ciborowski
Hi, thanks for your reply. I forgot to mention that this problem occurs with admin interface. Regards Przemek. W dniu wtorek, 26 sierpnia 2014 00:49:01 UTC+2 użytkownik somecallitblues napisał: > > Your problem is in the add view. Post your view code > On 26/08/2014 7:20 am, "Przemek Ciborowski

Re: Model - def __unicode__(self) - doesn't work

2014-08-26 Thread monoBOT
Be sure to returm a unicode object like this: def __unicode__(self): return u"%s" % self.name 2014-08-25 23:48 GMT+01:00 Mario Gudelj : > Your problem is in the add view. Post your view code > On 26/08/2014 7:20 am, "Przemek Ciborowski" wrote: > >> Hello guys, >> >> I'm really begi

Re: Model - def __unicode__(self) - doesn't work

2014-08-25 Thread Mario Gudelj
Your problem is in the add view. Post your view code On 26/08/2014 7:20 am, "Przemek Ciborowski" wrote: > Hello guys, > > I'm really beginner in django. > I have extremely simple example: > > class Vlan(models.Model): > name = models.CharField(max_length=30, name='Vlan name') > number = m

Re: Model - def __unicode__(self) - doesn't work

2014-08-25 Thread Babatunde Akinyanmi
Hi Przemek, I'm not sure there's a name attribute for Field and its subclasses. Does removing the name attribute work? On 25 Aug 2014 22:19, "Przemek Ciborowski" wrote: Hello guys, I'm really beginner in django. I have extremely simple example: class Vlan(models.Model): name = models.CharFi

Model - def __unicode__(self) - doesn't work

2014-08-25 Thread Przemek Ciborowski
Hello guys, I'm really beginner in django. I have extremely simple example: class Vlan(models.Model): name = models.CharField(max_length=30, name='Vlan name') number = models.IntegerField(default=0, name='Vlan number') def __unicode__(self): return self.name When I'm trying

Re: __unicode__(self) doesn't work

2009-10-12 Thread Arthur Metasov
2009/10/12 Denis Bahati > Hi there i have the problem with unicode function it doesn't give me any > changes. the poll list is displayed as Poll object and does doesn't give me > error if i write the models.py like this:from django.db import models > import datetime > > class Poll(models.Model):

Re: __unicode__(self) doesn't work

2009-10-12 Thread Ramiro Morales
On Mon, Oct 12, 2009 at 2:19 AM, Denis Bahati wrote: > if i change the code like the one shown below it gives me the traceback > about indents, i also included below. > from django.db import models > import datetime > class Poll(models.Model): >     question = models.CharField(max_length=200) >  

Re: __unicode__(self) doesn't work

2009-10-11 Thread Denis Bahati
Did you see my second post? I changed it still a problem On Mon, Oct 12, 2009 at 8:19 AM, Denis Bahati wrote: > Hi all, > I have a problem with __unicode__(self) function it doesn't give any > changes to the display of poll list it just display the Poll object when i > code like below: > > > fro

__unicode__(self) doesn't work

2009-10-11 Thread Denis Bahati
Hi all, I have a problem with __unicode__(self) function it doesn't give any changes to the display of poll list it just display the Poll object when i code like below: from django.db import models import datetime class Poll(models.Model): question = models.CharField(max_length=200) pub_

Re: __unicode__(self) doesn't work

2009-10-11 Thread Kenneth Gonsalves
On Monday 12 Oct 2009 10:39:48 am Denis Bahati wrote: > class Poll(models.Model): > question = models.CharField(max_length=200) > pub_date = models.DateTimeField('date published') > def __unicode__(self): > return self.question > def was_published_today(self): > return self.pub_date.date()

__unicode__(self) doesn't work

2009-10-11 Thread Denis Bahati
Hi there i have the problem with unicode function it doesn't give me any changes. the poll list is displayed as Poll object and does doesn't give me error if i write the models.py like this:from django.db import models import datetime class Poll(models.Model): question = models.CharField(max_l