I created a bug on code.djangoproject.com
<https://code.djangoproject.com/ticket/28098#ticket>
On Tuesday, 18 April 2017 13:12:05 UTC+1, Mohamed Ghariani wrote:
>
> Hello,
> I tried to apply migrations for a new model. The model was used in a form
> used in the admin so the migrations failed.
>
> He is a sample code i wrote which gave me the same errors.
>
>
> models.py
> from django.db import models
>
> class App(models.Model):
> name = models.CharField(max_length=50)
>
> forms.py
> from django import forms
>
> from app.models import App
>
>
> class AppForm(forms.ModelForm):
> name = ((elem.id, elem.name ) for elem in App.objects.all())
>
> admin.py
> from django.contrib import admin
>
> from app.forms import AppForm
> from app.models import App
>
>
> class AppAdmin(admin.ModelAdmin):
> search_fields = ('id', 'name')
> form = AppForm
> list_display = ('id', 'name')
>
> admin.site.register(App, AppAdmin)
>
>
> After running ./manage.py makemigrations i got this error
>
> django.db.utils.OperationalError: no such table: app_app
>
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/8ad0a967-40c2-443a-852b-1f199dd04192%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.