Help in Django-contact-form

36 views
Skip to first unread message

Akash Nimare

unread,
Jan 27, 2015, 4:04:42 PM1/27/15
to django...@googlegroups.com
Hello everyone. I am using a third party app django-contact-form. It is working fine but the problem is it does not show my models in admin. I can't see the data in admin. The docs are very poor.
Here is my model.py 

from django.db import models
from contact_form.forms import ContactForm
class ContactForm(models.Model):
    name
= models.CharField(max_length=100)
    email
= models.EmailField(max_length=200)
    body
= models.CharField(max_length=200)
   
def __str__(self):
       
return (self.email)

 admin.py
from django.contrib import admin
from . import models
from contact_form.models import ContactForm
class ContactFormAdmin(admin.ModelAdmin):
    list_display
= ("name", "body", "email")
admin
.site.register(ContactForm, ContactFormAdmin)
I am using django 1.7

Karim

unread,
Jan 27, 2015, 8:47:17 PM1/27/15
to Django Users
Can you show us also the view?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/035e8b0b-e502-4ba5-b8e2-9923afa43909%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Karim N. Gorjux

Vijay Khemlani

unread,
Jan 27, 2015, 9:24:25 PM1/27/15
to django...@googlegroups.com
And I'm not following, contact_form does not provide a ContactForm model, but you are providing one it seems, but it's on the same contact_form package as the library itself?

Also, the fact that the model class has the same name as the form class does not help much.

Reply all
Reply to author
Forward
0 new messages