Re: django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-27 Thread Anton Baklanov
Hi Héctor.

check this out
https://docs.djangoproject.com/en/dev//topics/python3/#str-and-unicode-methods

--
Regards,
Anton Baklanov

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread Anton Baklanov
Hi. I've just checked - it uses __unicode__() to display object names.

Please show us your full admin.py and models.py

-- 
Regards,
Anton Baklanov

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread Javier Guerra Giraldez
On Mon, Nov 26, 2012 at 12:10 PM, Anton Baklanov
 wrote:
> __str__ method works fine with python 3.

that's how it's supposed to be according to the six library.  kinda
makes sense, since in Py3 all strings are unicode

--
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread Anton Baklanov
__str__ method works fine with python 3.

i will continue searching the truth here and will create ticket (if it will
be required after finding truth)

thanks

On Mon, Nov 26, 2012 at 6:56 PM, ajendrex  wrote:

> Yes, I'm using python 3. I think there is no ticket for this yet, but I
> would prefer someone with better english and more time using django posted
> it.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread ajendrex
Yes, I'm using python 3. I think there is no ticket for this yet, but I 
would prefer someone with better english and more time using django posted 
it.

On Monday, November 26, 2012 1:38:04 PM UTC-3, bak1an wrote:
>
> No need for that. I've reproduced your problem. With python 3 __unicode__ 
> method is ignored.
>
> We should search for corresponding ticket on trac, or create new one.
>
> On Mon, Nov 26, 2012 at 6:31 PM, Anton Baklanov 
> 
> > wrote:
>
>> Hi. I've just checked - it uses __unicode__() to display object names.
>>
>> Please show us your full admin.py and models.py
>>
>> -- 
>> Regards,
>> Anton Baklanov
>>
>>
>
>
> -- 
> Regards,
> Anton Baklanov
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/eppiP4aM_VoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread Anton Baklanov
No need for that. I've reproduced your problem. With python 3 __unicode__
method is ignored.

We should search for corresponding ticket on trac, or create new one.

On Mon, Nov 26, 2012 at 6:31 PM, Anton Baklanov wrote:

> Hi. I've just checked - it uses __unicode__() to display object names.
>
> Please show us your full admin.py and models.py
>
> --
> Regards,
> Anton Baklanov
>
>


-- 
Regards,
Anton Baklanov

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread ajendrex
That doesn't solve the problem I stated. I still will be seeing a bounch of 
"Company Object" for every company that I register on the database.

I the image https://docs.djangoproject.com/en/dev/_images/admin04t.png from 
the tutorial, part 2, we can see how the poll objects are listed by using 
the result of __unicode__() function. (That's what one understands by 
reading the tutorial)

On Sunday, November 25, 2012 12:34:52 AM UTC-3, Lachlan Musicman wrote:
>
> I don't think you want unicode, I think you want: 
>
> class Meta: 
>verbose_name="Company" 
>verbose_name_plural = "Companies" 
>
> On Sun, Nov 25, 2012 at 8:27 AM, ajendrex > 
> wrote: 
> > Hello, 
> > 
> > I following the tutorial and realized that the admin pages are not using 
> the 
> > __unicode__() methods declared in my model: 
> > 
> > One of my classes: 
> > 
> > class Company(models.Model): 
> >   name = models.CharField(max_length=20) 
> >   description = models.CharField(max_length=500) 
> >   url = models.URLField(max_length=200) 
> >   createdAt = models.DateTimeField(auto_now_add=True) 
> > 
> >   def __unicode__(self): 
> > return self.name 
> > 
> > But the admin page to view and add companies shows the current list of 
> > companies with the label "Company object" instead of the names that I 
> gave 
> > to those registers. The same happens with the other classes of my model. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/django-users/-/-P162L-ktJYJ. 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > django-users...@googlegroups.com . 
> > For more options, visit this group at 
> > http://groups.google.com/group/django-users?hl=en. 
>
>
>
> -- 
> ...we look at the present day through a rear-view mirror. This is 
> something Marshall McLuhan said back in the Sixties, when the world 
> was in the grip of authentic-seeming future narratives. He said, “We 
> look at the present through a rear-view mirror. We march backwards 
> into the future.” 
>
> http://www.warrenellis.com/?p=14314 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/NBda0fUHphkJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-24 Thread Lachlan Musicman
I don't think you want unicode, I think you want:

class Meta:
   verbose_name="Company"
   verbose_name_plural = "Companies"

On Sun, Nov 25, 2012 at 8:27 AM, ajendrex  wrote:
> Hello,
>
> I following the tutorial and realized that the admin pages are not using the
> __unicode__() methods declared in my model:
>
> One of my classes:
>
> class Company(models.Model):
>   name = models.CharField(max_length=20)
>   description = models.CharField(max_length=500)
>   url = models.URLField(max_length=200)
>   createdAt = models.DateTimeField(auto_now_add=True)
>
>   def __unicode__(self):
> return self.name
>
> But the admin page to view and add companies shows the current list of
> companies with the label "Company object" instead of the names that I gave
> to those registers. The same happens with the other classes of my model.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-P162L-ktJYJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.



-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django 1.6.0: admin pages not using unicode methods declared in my model

2012-11-24 Thread ajendrex
Hello,

I following the tutorial and realized that the admin pages are not using 
the __unicode__() methods declared in my model:

One of my classes:

class Company(models.Model):
  name = models.CharField(max_length=20)
  description = models.CharField(max_length=500)
  url = models.URLField(max_length=200)
  createdAt = models.DateTimeField(auto_now_add=True)

  def __unicode__(self):
return self.name

But the admin page to view and add companies shows the current list of 
companies with the label "Company object" instead of the names that I gave 
to those registers. The same happens with the other classes of my model.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-P162L-ktJYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.