model containing himself in a many to many


I am trying to make uni course models, which means that every course has courses that “blocks him” (courses you have to take before you take this course).
I want to have a var like so:

    blocked_by = models.ManyToManyField(course,related_name="blocking",blank=True,null=True,default=None)

in side the course itself, but it gives me compiler error,

any ideas?

See the docs on ForeignKeys on how to define models that refer to themselves. (The docs for ManyToManyField specify that a recursive definition for it works exactly the same way as a ForeignKey field.)