On Jan 5, 8:12 am, "Antonio Ognio a.k.a gnrfan" <[EMAIL PROTECTED]>
wrote:
> On Jan 4, 8:11 pm, Lee Hinde <[EMAIL PROTECTED]> wrote:
>
> > I got some help on #django today that helped with this. Thanks!
>
> Could you share a bit of that bit us?
>
> I hit the same issue yesterday. Just found my way around by defining
> custom
> methods in the model class then adding them to the list_display tuple
> and setting
> the display title with short_description:
>
> class Example(models.Model):
> customer = models.ForeignKey(Customer, verbose_name=_('customer'))
> localfield = models.CharField(max_length=128,
> verbose_name=_('nave'))
>
> def show_customer(self):
> return self.customer
>
> show_customer.short_description = _('Customer')
>
> Admin:
> list_display = ('id', 'show_customer', 'localfield', )
>
> Now, I'm still puzzled on what triggers this error. I looks like it
> only happens
> with some models but works ok with the others.
>
> BTW I was able to reproduce it using lastest SVN (yesterday evening),
> some
> random old SVN copy I had (say, from a couple months ago) and with the
> 0.96.1 tarball. So the bug is still around for sure.
>
> I found this bug in the bugtracker opened 1 year ago:
>
> http://code.djangoproject.com/ticket/2583
>
> It says it hasn't been assigned to anyone yet. Any news?
I was migrating data from another system. It was extremely de-
normalized and one of the things I was doing was data normalizing it.
(that's why you'd see varietal and varietal_id in the table.)
I ended up with mysql fields that looked like 'varietal_id_id'.
This struck the person who helped me as odd. (I didn't care what the
fields were named, it's not like I was sending them to elementary
school with funky names.)
But since it struck the helpful person as odd, I felt I might have
been tripping over something that was freaking out django so, I
finished my data migration and deleted the original fields and left
just the foreign keys. I also renamed the foreign keys so they'd be as
django expected. I.e., I deleted the original varietal field and
renamed varietal_id to varietal (and adjusted the database
accordingly).
And it started working...
I'm so new to all of the components in this setup that I'm writing
this off as my problem for straying from the nest.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---