Thank you all. I used a tutorial *Amyth*, but I still could not run-error 
'MediaDefiningClass' 
object is not iterable. The following are my files, help reshist problem.
*admin.py*

from dipkurs.models import Disciplina, Raboty, Tipes

from django.contrib import admin

from tinymce.widgets import TinyMCE


class RabotyAdmin(admin.ModelAdmin):

list_display = ('tema', 'predmet', 'tip', 'pub_date')

list_filter = ['predmet']

search_fields = ['tema']


class TinyMCEAdmin(admin.ModelAdmin):

def formfield_for_dbfield(self, db_field, **kwargs):

if db_field.name in ('anounce', 'soderz', 'istochnik'):

return db_field.formfield(widget=TinyMCE(

attrs={'cols': 80, 'rows': 30},

mce_attrs={'external_link_list_url': 
reverse('tinymce.views.flatpages_link_list')},

))

return super(TinyMCEAdmin, self).formfield_for_dbfield(db_field, **kwargs)



admin.site.register(Raboty, RabotyAdmin)

admin.site.register(TinyMCEAdmin)

admin.site.register(Tipes)

admin.site.register(Disciplina)


*models.py*

#!/usr/bin/env python

#-*-coding:utf-8-*-

import os.path

from django.db import models

import datetime

from django.utils import timezone


class Disciplina(models.Model):

predmet = models.CharField(max_length=1000)


 def __unicode__(self):

return self.predmet


 class Meta:

verbose_name_plural = "Дисциплины"



class Tipes(models.Model):

tip = models.CharField(max_length=100)


 def __unicode__(self):

return self.tip


 class Meta:

verbose_name_plural = "Типы работ"



class Raboty(models.Model):

tema = models.CharField(max_length=300, verbose_name="Тема работы")

tip = models.ForeignKey(Tipes, verbose_name="Тип работы")

pub_date = models.DateTimeField('Дата публикации')

keywords = models.TextField(verbose_name="Ключевые слова")

predmet = models.ForeignKey(Disciplina, verbose_name="Предмет")

anounce = models.TextField(verbose_name="Описание работы")

soderz = models.TextField(verbose_name="Содержание")

istochnik = models.TextField(verbose_name="Список литературы")


 class Meta:

verbose_name_plural = "Работы"


 def __unicode__(self):

return self.tema


 def was_published_recently(self):

return self.datetime.timedelta(days=1)




понедельник, 20 августа 2012 г., 17:46:38 UTC+6 пользователь Amyth написал:
>
> Hey there, i could not really find a detailed step by step tutorial on 
> setting tinyMCE on django, so i did one for you and for others, you 
> can check it out here 
> http://techstricks.com/django-tinymce-tutorial-step-by-step/ and feel 
> free to ask any question if you face any problems 
>
> On Mon, Aug 20, 2012 at 4:40 PM, Aljoša Mohorović 
> <aljosa.m...@gmail.com <javascript:>> wrote: 
> > HTMLField() is probably the easiest way to use django-tinymce: 
> > 
> http://django-tinymce.readthedocs.org/en/latest/usage.html#the-htmlfield-model-field-type
>  
> > 
> > let me know if you have any issues. 
> > 
> > Aljosa 
> > -- 
> > https://twitter.com/maljosa 
> > https://github.com/aljosa 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Django users" group. 
> > To post to this group, send email to 
> > django...@googlegroups.com<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> django-users...@googlegroups.com <javascript:>. 
> > For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en. 
> > 
>
>
>
> -- 
> Thanks & Regards 
> ---------------------------- 
>
> Amyth [Admin - Techstricks] 
> Email - aroras....@gmail.com <javascript:>, 
> ad...@techstricks.com<javascript:> 
> Twitter - @a_myth_________ 
> http://techstricks.com/ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/JaEEDUuEWfEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to