#28098: Error while doing migrations for a new model that is used in an form in 
the
admin.py
--------------------------------------------+----------------------------
               Reporter:  GHARIANI Mohamed  |          Owner:  nobody
                   Type:  Bug               |         Status:  new
              Component:  Migrations        |        Version:  1.8
               Severity:  Normal            |       Keywords:  migrations
           Triage Stage:  Unreviewed        |      Has patch:  0
    Needs documentation:  0                 |    Needs tests:  0
Patch needs improvement:  0                 |  Easy pickings:  0
                  UI/UX:  0                 |
--------------------------------------------+----------------------------
 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)

 }}}

 While running  ./manage.py makemigrations i got this error

 {{{
 django.db.utils.OperationalError: no such table: app_app
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28098>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/059.d4b7238405ab0fa3cfc3526341e32941%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to