Structure for Django methods that span different models
        Posted  
        
            by Duncan
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Duncan
        
        
        
        Published on 2010-05-03T08:45:15Z
        Indexed on 
            2010/05/03
            8:48 UTC
        
        
        Read the original article
        Hit count: 276
        
I have two models (say A and B) which are independent and have independent methods. I want to add some methods that operate on both models though.
for example, addX() will create an object from both models A and B.
What's the best way to structure code in this situation, since it doesnt make sense to have the method belong to either of the models methods. Is the standard to write a service for the kind of 'abstract' model?
© Stack Overflow or respective owner