models pycompat