'Creates some methods once self._meta has been populated.'

def _prepare(cls):

    opts = cls._meta
    opts._prepare(cls)
    if opts.order_with_respect_to:
        cls.get_next_in_order = curry(cls._get_next_or_previous_in_order, is_next=True)
        cls.get_previous_in_order = curry(cls._get_next_or_previous_in_order, is_next=False)
        def make_foreign_order_accessors(field, model, cls):
            setattr(field.rel.to, (u'get_%s_order' % cls.__name__.lower()), curry(method_get_order, cls))
            setattr(field.rel.to, (u'set_%s_order' % cls.__name__.lower()), curry(method_set_order, cls))
        add_lazy_relation(cls, opts.order_with_respect_to, opts.order_with_respect_to.rel.to, make_foreign_order_accessors)
    if (cls.__doc__ is None):
        cls.__doc__ = (u'%s(%s)' % (cls.__name__, u',    '.join([f.attname for f in opts.fields])))
    if hasattr(cls, u'get_absolute_url'):
        cls.get_absolute_url = update_wrapper(curry(get_absolute_url, opts, cls.get_absolute_url), cls.get_absolute_url)
    signals.class_prepared.send(sender=cls)
