Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Tech(models.Model):
- name = models.CharField(max_length = 30)
- class Project(models.Model):
- title = models.CharField(max_length = 50)
- techs = models.ManyToManyField(Tech)
- class TechInline(admin.TabularInline):
- model = Tech
- extra = 5
- class ProjectAdmin(admin.ModelAdmin):
- fields = ['title']
- inlines = []
- list_display = ('title')
- admin.site.register(Project, ProjectAdmin)
- <class 'home.projects.models.Tech'> has no ForeignKey to <class 'home.projects.models.Project'>
- python manage.py sqlreset <myapp>
Add Comment
Please, Sign In to add comment