Re: How to add tinyMCE to django 1.0.2 admin

2009-01-14 Thread Oleg Oltar
it, worked!
thanks everyone!

On Wed, Jan 14, 2009 at 3:40 PM, kamil  wrote:

>
> Hi Oleg
>
> You must create your admin config eg:
>
> class ArticleOptions(admin.ModelAdmin):
>
>class Media:
>js = ('/static_media/js/tiny_mce/tiny_mce.js', '/static_media/
> js/textareas.js')
>
>
> Please check if it correspond to your urs.
> good luck
> kamil
>
> On Jan 13, 9:43 pm, "Oleg Oltar"  wrote:
> > Hi!
> >
> > I want to add tinyMCE to my project's admin site. I downloaded the latest
> > version of the editor, added the js/tiny_mce to my media files
> >
> > Added following to my urls.py
> > from django.conf.urls.defaults import *
> >
> > # Uncomment the next two lines to enable the admin:
> > from django.contrib import admin
> > admin.autodiscover()
> >
> > urlpatterns = patterns('django.views.generic.simple',
> >(r'^contacts$',
> > 'direct_to_template',{'template':'visitcard/contacts.html'} ),
> >(r'^construction$',
> > 'direct_to_template',{'template':'visitcard/construction.html'}),
> >(r'^portfolio1$',
> > 'direct_to_template',{'template':'visitcard/portfolio.html'}),
> >(r'^partners$',
> > 'direct_to_template',{'template':'visitcard/partners.html'}),
> >(r'^articles$',
> > 'direct_to_template',{'template':'visitcard/artilcles.html'}),
> >(r'^portfolio$',
> > 'direct_to_template',{'template':'visitcard/portfolio1.html'}),
> >(r'^dom_karkasnij$', 'direct_to_template',
> > {'template':'visitcard/dom_karkas.html'}),
> >(r'^$',
> > 'direct_to_template',{'template':'visitcard/index.html'} ),
> >
> >)
> >
> > urlpatterns +=  patterns('',
> >
> > (r'^tiny_mce/(?P.*)$','django.views.static.serve',
> >   {'document_root':
> > '/Users/oleg/Desktop/TECHNOBUD/TEMPLATES/static_media/js/tiny_mce' }),
> >  (r'^admin/', include('cms.admin_urls')),
> >  (r'^admin/(.*)', admin.site.root),
> >  )
> >
> > Also created the config for tinyMCE: textareas.js
> > tinyMCE.init({
> > mode : "textareas",
> > theme : "advanced",
> > //content_css : "/appmedia/blog/style.css",
> > theme_advanced_toolbar_location : "top",
> > theme_advanced_toolbar_align : "left",
> > theme_advanced_buttons1 :
> >
> "fullscreen,separator,preview,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,separator,image,cleanup,help,separator,code",
> > theme_advanced_buttons2 : "",
> > theme_advanced_buttons3 : "",
> > auto_cleanup_word : true,
> > plugins :
> >
> "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,fullscreen",
> > plugin_insertdate_dateFormat : "%m/%d/%Y",
> > plugin_insertdate_timeFormat : "%H:%M:%S",
> > extended_valid_elements :
> >
> "a[name|href|target=_blank|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
> > fullscreen_settings : {
> > theme_advanced_path_location : "top",
> > theme_advanced_buttons1 :
> >
> "fullscreen,separator,preview,separator,cut,copy,paste,separator,undo,redo,separator,search,replace,separator,code,separator,cleanup,separator,bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,help",
> > theme_advanced_buttons2 :
> >
> "removeformat,styleselect,formatselect,fontselect,fontsizeselect,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor",
> > theme_advanced_buttons3 :
> >
> "sub,sup,separator,image,insertdate,inserttime,separator,tablecontrols,separator,hr,advhr,visualaid,separator,charmap,emotions,iespell,flash,separator,print"
> > }
> >
> > });
> >
> > My models file:
> > from django.db import models
> >
> > class Article(models.Model):
> > title = models.CharField(max_length=60)
> > body = models.TextField(max_length=3000)
> > slug = models.SlugField(unique=True)
> >
> > The editor is still not appearing on my admin interface, when I am trying
> to
> > add articles... Did I miss something? Please help me to understand the
> > problem
> >
> > Thanks,
> > Oleg
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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

Re: How to add tinyMCE to django 1.0.2 admin

2009-01-14 Thread kamil

Hi Oleg

You must create your admin config eg:

class ArticleOptions(admin.ModelAdmin):

class Media:
js = ('/static_media/js/tiny_mce/tiny_mce.js', '/static_media/
js/textareas.js')


Please check if it correspond to your urs.
good luck
kamil

On Jan 13, 9:43 pm, "Oleg Oltar"  wrote:
> Hi!
>
> I want to add tinyMCE to my project's admin site. I downloaded the latest
> version of the editor, added the js/tiny_mce to my media files
>
> Added following to my urls.py
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('django.views.generic.simple',
>                        (r'^contacts$',
> 'direct_to_template',{'template':'visitcard/contacts.html'} ),
>                        (r'^construction$',
> 'direct_to_template',{'template':'visitcard/construction.html'}),
>                        (r'^portfolio1$',
> 'direct_to_template',{'template':'visitcard/portfolio.html'}),
>                        (r'^partners$',
> 'direct_to_template',{'template':'visitcard/partners.html'}),
>                        (r'^articles$',
> 'direct_to_template',{'template':'visitcard/artilcles.html'}),
>                        (r'^portfolio$',
> 'direct_to_template',{'template':'visitcard/portfolio1.html'}),
>                        (r'^dom_karkasnij$', 'direct_to_template',
> {'template':'visitcard/dom_karkas.html'}),
>                        (r'^$',
> 'direct_to_template',{'template':'visitcard/index.html'} ),
>
>                        )
>
> urlpatterns +=  patterns('',
>
> (r'^tiny_mce/(?P.*)$','django.views.static.serve',
>                           {'document_root':
> '/Users/oleg/Desktop/TECHNOBUD/TEMPLATES/static_media/js/tiny_mce' }),
>                          (r'^admin/', include('cms.admin_urls')),
>                          (r'^admin/(.*)', admin.site.root),
>                          )
>
> Also created the config for tinyMCE: textareas.js
> tinyMCE.init({
>     mode : "textareas",
>     theme : "advanced",
>     //content_css : "/appmedia/blog/style.css",
>     theme_advanced_toolbar_location : "top",
>     theme_advanced_toolbar_align : "left",
>     theme_advanced_buttons1 :
> "fullscreen,separator,preview,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,separator,image,cleanup,help,separator,code",
>     theme_advanced_buttons2 : "",
>     theme_advanced_buttons3 : "",
>     auto_cleanup_word : true,
>     plugins :
> "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,fullscreen",
>     plugin_insertdate_dateFormat : "%m/%d/%Y",
>     plugin_insertdate_timeFormat : "%H:%M:%S",
>     extended_valid_elements :
> "a[name|href|target=_blank|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
>     fullscreen_settings : {
>         theme_advanced_path_location : "top",
>         theme_advanced_buttons1 :
> "fullscreen,separator,preview,separator,cut,copy,paste,separator,undo,redo,separator,search,replace,separator,code,separator,cleanup,separator,bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,help",
>         theme_advanced_buttons2 :
> "removeformat,styleselect,formatselect,fontselect,fontsizeselect,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor",
>         theme_advanced_buttons3 :
> "sub,sup,separator,image,insertdate,inserttime,separator,tablecontrols,separator,hr,advhr,visualaid,separator,charmap,emotions,iespell,flash,separator,print"
>     }
>
> });
>
> My models file:
> from django.db import models
>
> class Article(models.Model):
>     title = models.CharField(max_length=60)
>     body = models.TextField(max_length=3000)
>     slug = models.SlugField(unique=True)
>
> The editor is still not appearing on my admin interface, when I am trying to
> add articles... Did I miss something? Please help me to understand the
> problem
>
> Thanks,
> Oleg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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
-~--~~~~--~~--~--~---



Re: How to add tinyMCE to django 1.0.2 admin

2009-01-14 Thread Oleg Oltar
yep, trying it
But still not sure how to add it to admin

On Wed, Jan 14, 2009 at 10:54 AM, izzy_dizzy  wrote:

>
> Try using django-tiny_mce
>
> Here's its documentation:
> http://django-tinymce.googlecode.com/svn/tags/release-1.2/docs/.build/html/index.html
>
>
>
> On Jan 14, 3:26 pm, "Oleg Oltar"  wrote:
> > Ok, I read the doc...But not sure if I done everything correctly, as the
> > tinyMCE is still not in my admin
> >
> > So what I've done:
> >
> > beryl:TECHNOBUD oleg$ cp
> >
> /Users/oleg/src/django1.0/django/contrib/admin/templates/admin/change_form.html
> > ./TEMPLATES/admin/
> >
> > Then I edited copied file and added:
> >
> > 
> > 
> > tinyMCE.init({
> > mode: "textareas",
> > theme:"simple"});
> >
> > 
> >
> > after the line:
> >
> > 
> >
> > (I read this solution in practical-django-projects book)
> >
> > That's all what I've done so far. But the editor still didn't appear
> >
> > Thanks,
> > Oleg
> >
> > On Wed, Jan 14, 2009 at 12:18 AM, Brian Neal  wrote:
> >
> > > On Jan 13, 3:43 pm, "Oleg Oltar"  wrote:
> > > > Hi!
> >
> > > > I want to add tinyMCE to my project's admin site.
> >
> > > You didn't list any admin.py code. Check out the docs on the admin
> > > interface:
> >
> > >http://docs.djangoproject.com/en/dev/ref/contrib/admin/#module-django.
> ..
> >
> > > After you read through that, pay attention to the ModelAdmin media
> > > definitions:
> >
> > >http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-me.
> ..
> >
> > > It is there you specify the tinymce javascript files. When the admin
> > > displays the form for your models it will generate the appropriate
> > > script tags to the javascript files.
> >
> > > Good luck!
> > > BN
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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
-~--~~~~--~~--~--~---



Re: How to add tinyMCE to django 1.0.2 admin

2009-01-14 Thread izzy_dizzy

Try using django-tiny_mce

Here's its documentation: 
http://django-tinymce.googlecode.com/svn/tags/release-1.2/docs/.build/html/index.html



On Jan 14, 3:26 pm, "Oleg Oltar"  wrote:
> Ok, I read the doc...But not sure if I done everything correctly, as the
> tinyMCE is still not in my admin
>
> So what I've done:
>
> beryl:TECHNOBUD oleg$ cp
> /Users/oleg/src/django1.0/django/contrib/admin/templates/admin/change_form.html
> ./TEMPLATES/admin/
>
> Then I edited copied file and added:
>
> 
> 
> tinyMCE.init({
> mode: "textareas",
> theme:"simple"});
>
> 
>
> after the line:
>
> 
>
> (I read this solution in practical-django-projects book)
>
> That's all what I've done so far. But the editor still didn't appear
>
> Thanks,
> Oleg
>
> On Wed, Jan 14, 2009 at 12:18 AM, Brian Neal  wrote:
>
> > On Jan 13, 3:43 pm, "Oleg Oltar"  wrote:
> > > Hi!
>
> > > I want to add tinyMCE to my project's admin site.
>
> > You didn't list any admin.py code. Check out the docs on the admin
> > interface:
>
> >http://docs.djangoproject.com/en/dev/ref/contrib/admin/#module-django...
>
> > After you read through that, pay attention to the ModelAdmin media
> > definitions:
>
> >http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-me...
>
> > It is there you specify the tinymce javascript files. When the admin
> > displays the form for your models it will generate the appropriate
> > script tags to the javascript files.
>
> > Good luck!
> > BN

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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
-~--~~~~--~~--~--~---



Re: How to add tinyMCE to django 1.0.2 admin

2009-01-14 Thread Oleg Oltar
Also my admin code is

from TECHNOBUD.visitcard.models import Article

from django.contrib import admin

admin.site.register(Article)


Need help :(


I tried to do everything from the beginning, so started a new project.
I added there django tiny_mce application.

I added these code to my settings file:

TINYMCE_JS_URL='http://127.0.0.1:8000/smedia/js/tiny_mce/tiny_mce_src.js'



TINYMCE_DEFAULT_CONFIG={
'theme': 'advanced',
'mode': 'textareas',
}



Also added a line to urls:
(r'^tinymce/', include('tinymce.urls')),

But still, not sure how to make my fields be represented by the mce

Please help!


On Wed, Jan 14, 2009 at 9:26 AM, Oleg Oltar  wrote:

> Ok, I read the doc...But not sure if I done everything correctly, as the
> tinyMCE is still not in my admin
>
> So what I've done:
>
> beryl:TECHNOBUD oleg$ cp
> /Users/oleg/src/django1.0/django/contrib/admin/templates/admin/change_form.html
> ./TEMPLATES/admin/
>
> Then I edited copied file and added:
>
> 
> 
> tinyMCE.init({
> mode: "textareas",
> theme:"simple"
> });
> 
>
> after the line:
>
> 
>
> (I read this solution in practical-django-projects book)
>
>
>
> That's all what I've done so far. But the editor still didn't appear
>
> Thanks,
> Oleg
>
> On Wed, Jan 14, 2009 at 12:18 AM, Brian Neal  wrote:
>
>>
>> On Jan 13, 3:43 pm, "Oleg Oltar"  wrote:
>> > Hi!
>> >
>> > I want to add tinyMCE to my project's admin site.
>>
>> You didn't list any admin.py code. Check out the docs on the admin
>> interface:
>>
>>
>> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#module-django.contrib.admin
>>
>> After you read through that, pay attention to the ModelAdmin media
>> definitions:
>>
>>
>> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions
>>
>> It is there you specify the tinymce javascript files. When the admin
>> displays the form for your models it will generate the appropriate
>> script tags to the javascript files.
>>
>> Good luck!
>> BN
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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
-~--~~~~--~~--~--~---



Re: How to add tinyMCE to django 1.0.2 admin

2009-01-13 Thread Oleg Oltar
Ok, I read the doc...But not sure if I done everything correctly, as the
tinyMCE is still not in my admin

So what I've done:

beryl:TECHNOBUD oleg$ cp
/Users/oleg/src/django1.0/django/contrib/admin/templates/admin/change_form.html
./TEMPLATES/admin/

Then I edited copied file and added:



tinyMCE.init({
mode: "textareas",
theme:"simple"
});


after the line:



(I read this solution in practical-django-projects book)



That's all what I've done so far. But the editor still didn't appear

Thanks,
Oleg
On Wed, Jan 14, 2009 at 12:18 AM, Brian Neal  wrote:

>
> On Jan 13, 3:43 pm, "Oleg Oltar"  wrote:
> > Hi!
> >
> > I want to add tinyMCE to my project's admin site.
>
> You didn't list any admin.py code. Check out the docs on the admin
> interface:
>
>
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#module-django.contrib.admin
>
> After you read through that, pay attention to the ModelAdmin media
> definitions:
>
>
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions
>
> It is there you specify the tinymce javascript files. When the admin
> displays the form for your models it will generate the appropriate
> script tags to the javascript files.
>
> Good luck!
> BN
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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
-~--~~~~--~~--~--~---



Re: How to add tinyMCE to django 1.0.2 admin

2009-01-13 Thread Brian Neal

On Jan 13, 3:43 pm, "Oleg Oltar"  wrote:
> Hi!
>
> I want to add tinyMCE to my project's admin site.

You didn't list any admin.py code. Check out the docs on the admin
interface:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#module-django.contrib.admin

After you read through that, pay attention to the ModelAdmin media
definitions:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions

It is there you specify the tinymce javascript files. When the admin
displays the form for your models it will generate the appropriate
script tags to the javascript files.

Good luck!
BN
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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
-~--~~~~--~~--~--~---



How to add tinyMCE to django 1.0.2 admin

2009-01-13 Thread Oleg Oltar
Hi!

I want to add tinyMCE to my project's admin site. I downloaded the latest
version of the editor, added the js/tiny_mce to my media files

Added following to my urls.py
from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('django.views.generic.simple',
   (r'^contacts$',
'direct_to_template',{'template':'visitcard/contacts.html'} ),
   (r'^construction$',
'direct_to_template',{'template':'visitcard/construction.html'}),
   (r'^portfolio1$',
'direct_to_template',{'template':'visitcard/portfolio.html'}),
   (r'^partners$',
'direct_to_template',{'template':'visitcard/partners.html'}),
   (r'^articles$',
'direct_to_template',{'template':'visitcard/artilcles.html'}),
   (r'^portfolio$',
'direct_to_template',{'template':'visitcard/portfolio1.html'}),
   (r'^dom_karkasnij$', 'direct_to_template',
{'template':'visitcard/dom_karkas.html'}),
   (r'^$',
'direct_to_template',{'template':'visitcard/index.html'} ),


   )


urlpatterns +=  patterns('',

(r'^tiny_mce/(?P.*)$','django.views.static.serve',
  {'document_root':
'/Users/oleg/Desktop/TECHNOBUD/TEMPLATES/static_media/js/tiny_mce' }),
 (r'^admin/', include('cms.admin_urls')),
 (r'^admin/(.*)', admin.site.root),
 )


Also created the config for tinyMCE: textareas.js
tinyMCE.init({
mode : "textareas",
theme : "advanced",
//content_css : "/appmedia/blog/style.css",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 :
"fullscreen,separator,preview,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,separator,image,cleanup,help,separator,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
auto_cleanup_word : true,
plugins :
"table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,fullscreen",
plugin_insertdate_dateFormat : "%m/%d/%Y",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements :
"a[name|href|target=_blank|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
fullscreen_settings : {
theme_advanced_path_location : "top",
theme_advanced_buttons1 :
"fullscreen,separator,preview,separator,cut,copy,paste,separator,undo,redo,separator,search,replace,separator,code,separator,cleanup,separator,bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,help",
theme_advanced_buttons2 :
"removeformat,styleselect,formatselect,fontselect,fontsizeselect,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor",
theme_advanced_buttons3 :
"sub,sup,separator,image,insertdate,inserttime,separator,tablecontrols,separator,hr,advhr,visualaid,separator,charmap,emotions,iespell,flash,separator,print"
}
});

My models file:
from django.db import models

class Article(models.Model):
title = models.CharField(max_length=60)
body = models.TextField(max_length=3000)
slug = models.SlugField(unique=True)

The editor is still not appearing on my admin interface, when I am trying to
add articles... Did I miss something? Please help me to understand the
problem

Thanks,
Oleg

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
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
-~--~~~~--~~--~--~---