Re: Load ForeignKey label instead of ID in Charfield

2010-12-02 Thread bnabilos
Hi, Thank you for your answer. That's right, I'm using a ForeignKey from a model to another and I'm allowing users to edit it by entring text. It's for a school project, I've added a method in my form (clean_field(self)) that creates and saves an object based on what the user wrote. I did that to

Load ForeignKey label instead of ID in Charfield

2010-12-02 Thread bnabilos
Hello, I'm using a ForeignKey in my model and a Charfield in my form, when I save data everything works well but when I try to edit something, I get the ForeignKey ID in the Charfield. There is a way to display the label instead of the ID when editing an entry ? Thank you -- You received this

Re: Create an object before calling the save method

2010-11-29 Thread bnabilos
Hi, Thank you for your answer. I will explain what I want to do. Let's say that we have Category and Article classes in our model, each one has a title. To make this title reusable, I created another application that will manage fields, I created the class Title and I added it as foreignkey to C

Create an object before calling the save method

2010-11-27 Thread bnabilos
Hello I want to create an object in Django before calling the save method. This object will be created from a ForeignKey Value, I've changed the foreignkey field to look like an input field in order to write a value instead of selecting it. I have 2 classes in 2 different model files class Categ