Re: How to define non-persisted attributes in Model

2007-03-11 Thread Horst Gutmann
Do you really need a CharField here or would a simply string variable be enough? So you could simply do something like class Message(models.Model): description = models.CharField(maxlength=200) author = models.ForeignKey(User) temp = "" and it should never get stored in the data

Re: How to define non-persisted attributes in Model

2007-03-10 Thread anders conbere
well like I said you can either make that particular field not a model object, or you could just add the attributes at run time. I'm not familiar with using the json serializer so I'm not sure about the specifics there, but for simply adding attributes to the model that wouldn't be saved to the d

Re: How to define non-persisted attributes in Model

2007-03-10 Thread Kenny Lee
I need a model as i will need to save to the database. Just that i need to serialize the object to send it to json, and it will be helpful to have some custom attributes for temporary processing, but will not be saved to the db. On 3/10/07, anders conbere <[EMAIL PROTECTED]> wrote: > > > I would j

Re: How to define non-persisted attributes in Model

2007-03-10 Thread anders conbere
I would just not make it a model.* since you don't want that value to be part of the Database, just don't use the ORM for it. ~ Anders On 3/10/07, shevken <[EMAIL PROTECTED]> wrote: > > class Message(models.Model): > description = models.CharField(maxlength=200) > author = models.Foreign