Re: Override Method on DB get / filter / all

2011-02-13 Thread Jani Tiainen
On Sunday 13 February 2011 18:18:39 BW wrote: > I know you can override the save() method in a model, but is it > possible to do it when you try to get a row or rows from a db? I have > data like this '\xFF\x00\x00\x00\xFE'... that I need to store in a > MySQL db. > > When I was trying to save

Re: Override Method on DB get / filter / all

2011-02-13 Thread Shawn Milochik
You can make a custom manager. http://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers-and-model-inheritance You probably don't realize it from normal use, but the 'objects' property you're using on your models is an instance of models.Manager, not an internal part of the

Override Method on DB get / filter / all

2011-02-13 Thread BW
I know you can override the save() method in a model, but is it possible to do it when you try to get a row or rows from a db? I have data like this '\xFF\x00\x00\x00\xFE'... that I need to store in a MySQL db. When I was trying to save it I was getting an error. Now I override the __save__