Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
selectboxes with references to other objects
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Vorik  
View profile  
 More options Apr 16 2007, 2:45 am
From: "Vorik" <goo...@gerapeldoorn.nl>
Date: Sun, 15 Apr 2007 23:45:45 -0700
Local: Mon, Apr 16 2007 2:45 am
Subject: selectboxes with references to other objects
Hi!

I'm gettings some strange stuff in my selectboxes that represent
belongs_to and has_many relationships:

    #<Opleiding:0xb76dc6e0>

I'd really like this field(selectbox) to contain the name of the
'opleiding', instead of the object-id.

How can I override this?

Many thanks,
Ger Apeldoorn


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vorik  
View profile  
 More options Apr 16 2007, 3:23 am
From: "Vorik" <goo...@gerapeldoorn.nl>
Date: Mon, 16 Apr 2007 00:23:52 -0700
Local: Mon, Apr 16 2007 3:23 am
Subject: Re: selectboxes with references to other objects
I've found out that if I add a 'name' column for the referenced
object, this gets put in the selectbox. However, my table has a 'naam'
field. Is it possible to override this without changing the column
name?

Thanks,
Ger.

On Apr 16, 8:45 am, "Vorik" <goo...@gerapeldoorn.nl> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Han Holl  
View profile  
 More options Apr 16 2007, 5:04 am
From: "Han Holl" <han.h...@gmail.com>
Date: Mon, 16 Apr 2007 02:04:51 -0700
Local: Mon, Apr 16 2007 5:04 am
Subject: Re: selectboxes with references to other objects

On Apr 16, 9:23 am, "Vorik" <goo...@gerapeldoorn.nl> wrote:

> I've found out that if I add a 'name' column for the referenced
> object, this gets put in the selectbox. However, my table has a 'naam'
> field. Is it possible to override this without changing the column
> name?

You want:
  def to_label
    self.naam
  end

in your model.

Cheers,

Han Holl


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vorik  
View profile  
 More options Apr 16 2007, 1:31 pm
From: "Vorik" <goo...@gerapeldoorn.nl>
Date: Mon, 16 Apr 2007 10:31:47 -0700
Local: Mon, Apr 16 2007 1:31 pm
Subject: Re: selectboxes with references to other objects
Thanks a lot, i'll try it out tomorrow!!

Greetings,
Ger.

On Apr 16, 11:04 am, "Han Holl" <han.h...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »