How to set the sucess message after inserting values to db in django admin
site
like message department added sucessfully
model:
class departmentForm(forms.ModelForm):
model=mdldepartments
def clean(self):
dept_msg = u"Department name allows only characters."
cleaned_data = self.cleaned_data
dept = cleaned_data.get("dept_name")
pattern = re.compile("([A-Z,a-z])")
if not pattern.match(dept):
self._errors["dept_name"] = ErrorList([dept_msg])
#else:
# self.
return cleaned_data
class mdldepartmentsAdmin(admin.ModelAdmin):
form=departmentForm
list_display = ('dept_name','status')
search_fields = ['dept_name']
list_filter = ['status']
admin.site.register(mdldepartments,mdldepartmentsAdmin)
And i tried to enable the messaging module in django but in django.contrib
messages folder is missing
my django version is 1.1
Thaks
Radhika
--
View this message in context:
http://old.nabble.com/How-to-set-the-sucess-message-after-inserting-values-to-db-in-django-admin-site-tp28324413p28324413.html
Sent from the django-developers mailing list archive at Nabble.com.
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.