Opened 5 years ago

Closed 5 years ago

#19499 closed Bug (invalid)

databasse error

Reported by: vinthkumar@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.4
Severity: Normal Keywords: database error
Cc: vinothkumar@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


hi i'm new learner for django.

i decalare the class like this

class MAccount(models.Model):
    act_id = models.CharField(primary_key=True, max_length=8, null=False, unique=True)
    pwd = models.CharField(max_length=20, null=False)
    name = models.CharField(max_length=25, null=False)
    address = models.TextField()
    phone = models.CharField(max_length=13, null=False)
    email = models.EmailField(null=False)

#create Event table
class MEvent(models.Model):
    event_id = models.CharField(primary_key=True, max_length=20, null=False, unique=True)
    name = models.CharField(max_length=50, null=False)    
    date = models.DateField(null=False, blank=False)
    image = models.ImageField(upload_to='img', blank=False)
    loc = models.TextField()    
    email = models.EmailField(null=False)
    acc_id = models.ForeignKey(MAccount)

def eventcreate(request):
    if request.method == 'POST': # If the form has been submitted...
        form = models.MEventForm(request.POST, request.FILES) # A form bound to the POST data
        if form.is_valid(): # All validation rules pass
            # Process the data in form.cleaned_data
            # ...
            return HttpResponseRedirect('/detail/') # Redirect after POST
        form = models.MEventForm() # An unbound form

    return render(request, 'eventcreate.html', {
        'form': form,

def detail(request):
    latest_list = MEvent.objects.all().order_by('-event_id') [:10]
    temp = {'latest_list': latest_list}
    return render_to_response('detail.html', temp, context_instance=RequestContext(request))

i added a value in MAccount cllass and MEvent class i need to display that all records in MEvent class. when i goto the detail.html page i get this error. how can i solve this error.

DatabaseError at /detail/
no such column: accountapp_mevent.acc_id_id
Request Method: GET
Request URL:
Django Version: 1.4.2
Exception Type: DatabaseError
Exception Value:
no such column: accountapp_mevent.acc_id_id
Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/ in execute, line 344
Python Executable: /usr/bin/python2.7
Python Version: 2.7.3
Python Path:


Server time: Thu, 20 Dec 2012 03:27:50 -0600

Change History (1)

comment:1 Changed 5 years ago by Ramiro Morales

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top