python - Custom Managers and "through" -


I have many relationships in my demo app, where I use the heavier of the manager's "add" method Am (i.e. album.photos.add ()).

I think there is now a need to store some data about multiple relationships, but I do not want to lose the add method. Can I set a default value for all the extra fields of "medium" and can I re-apply the add method in any way?

I do not really know much about custom managers, but I suspect that the right place to look may be.

Update:

Does anyone know how to do this?

Do I have to do this to anyone?

In simple ways, just add one method to the album (i.e. album.add_photo ( )) Which handles the metadata and creates a properly linked photo frequency.

If you want to get all the funky, you can write a custom management for the photo, make it the default (i.e. the previously planned manager), set it on, and add it a add () Method which is able to set the default metadata properly for the connection.

On one side: It seems that it will not be very difficult for Django to make generic; Instead of removing the add () method through the table, simply add () arbitrarily accept the quadrice and treat them as data through the table.


Comments