[mezzanine-users] Re: "You are trying to add a non-nullable field 'form_ptr' to aboutpage without a default;"

2017-10-16 Thread Tom Tanner
In this case, what is `form_ptr`? It isn't a field I defined anywhere, as 
far as I know

On Monday, October 16, 2017 at 12:56:41 PM UTC-4, Rainell Dilou Gómez wrote:
>
> When you add a field to an existing model and run makemigrations, if you 
> have not explicitly specified the default value for the new field, Django 
> asks you what data will you put by default in the new field. If you don't 
> want Django ask to you, you can edit the migration file manually, but ... 
> why make manually something that Django can do for you? ;-) 
> Then you have 2 options, or specify explicitly the default value for the 
> new field using *default='your_value'*, or you answer to Django when ask 
> you what value to set by default.
>
> Il giorno lunedì 16 ottobre 2017 05:05:15 UTC+2, Tom Tanner ha scritto:
>>
>> Here's what my Mezzanine theme's `models.py` looks like.
>>
>> from __future__ import unicode_literals
>>
>>
>> from django.db import models
>> from django.core.urlresolvers import reverse
>> from django.utils.translation import ugettext_lazy as _
>>
>>
>> from mezzanine.conf import settings
>> from mezzanine.core.fields import FileField, RichTextField
>> from mezzanine.core.models import Displayable, Ownable, RichText, Slugged
>> from mezzanine.generic.fields import CommentsField, RatingField
>> from mezzanine.utils.models import AdminThumbMixin, upload_to
>> from mezzanine.forms.models import Form
>>
>>
>> class AboutPage(Form):
>>  '''
>>  All-in-one about page
>>  '''
>>
>>
>>  site_description= RichTextField(_("About"), help_text=_("A short 
>> description of this website."))
>>
>>
>>  class Meta:
>>  verbose_name=_("About page")
>>  verbose_name_plural=_("About pages")
>>
>> When I run `python manage.py makemigrations`, I get this message.
>>
>> You are trying to add a non-nullable field 'form_ptr' to aboutpage 
>> without a default; we can't do that (the database needs something to 
>> populate existing rows).
>> Please select a fix:
>>  1) Provide a one-off default now (will be set on all existing rows with 
>> a null value for this column)
>>  2) Quit, and let me add a default in models.py
>> Select an option: 2
>>
>>
>> How do I change my `AboutPage` class to avoid this message? 
>>
>> My goal is to make a page that where I can put a form with descriptions 
>> and other info for my site. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Adding a Button to TinyMCE Issue

2017-10-16 Thread marcusguttenplan
Thank you for your response!

I had tried to use this (from tinymce docs 
) in the init 
function:
toolbar: 'hrbutton',

setup: function (editor) {
console.log("setup fn hit");
editor.addButton('hrbutton', {
  text: '|',
  icon: false,
  onclick: function () {
editor.insertContent('');
  }
});
},

but with no success. Your question made me realize that I had been editing 
grapelli's tinymce_setup and not mezzanine's. Unfortunately the same 
toolbar field and setup function do not work in mezzanine's tinymce_setup 
either. The changes were't appearing at all. Finally overriding the default 
tinymce_setup worked fine.

TINYMCE_SETUP_JS = 'js/customtinymce_setup.js'


Thank you for your help!



On Monday, October 16, 2017 at 7:38:58 PM UTC-7, Ryne Everett wrote:
>
> Pardon if I'm misunderstanding the question, but are you adding it to 
> the toolbar field in tinymce_setup? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Adding a Button to TinyMCE Issue

2017-10-16 Thread Ryne Everett
Pardon if I'm misunderstanding the question, but are you adding it to
the toolbar field in tinymce_setup?

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Adding a Button to TinyMCE Issue

2017-10-16 Thread marcusguttenplan
I have been working to add a custom button to tinyMCE, but the button is 
not appearing and I am having trouble debugging. I looked through past 
questions on here, as well as SO and the tinyMCE docs, but haven't found a 
solution that works.

I want to add a button for an hr tag. There is a plugin that exists for this 
 (though with the default parent 
menu "insert"). I've added it to the plugins option.

plugins: 
"hr,advimage,advlink,fullscreen,paste,media,searchreplace,grappelli,grappelli_contextmenu,template"
,

I have also tried 
theme_advanced_buttons1: 
"formatselect,styleselect,|,bold,italic,underline,|,bullist,numlist,blockquote,|,undo,redo,|,link,unlink,|,image,|,fullscreen,|,hr,|,grappelli_adv"
,

As well as
theme_advanced_buttons1_add:
from the docs.

I've also tried registering the hr button inside of 
`theme_advanced_buttons2` and `theme_advanced_blockformats`, but neither of 
those work. Maybe I need to override the plugin's default parent? Do I need 
to create the plugin myself an include it, or download from source?

Any advice or a point in the right direction would be appreciated! Thank 
you for your time and for a great open source project.

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: "You are trying to add a non-nullable field 'form_ptr' to aboutpage without a default;"

2017-10-16 Thread Rainell Dilou Gómez
When you add a field to an existing model and run makemigrations, if you 
have not explicitly specified the default value for the new field, Django 
asks you what data will you put by default in the new field. If you don't 
want Django ask to you, you can edit the migration file manually, but ... 
why make manually something that Django can do for you? ;-) 
Then you have 2 options, or specify explicitly the default value for the 
new field using *default='your_value'*, or you answer to Django when ask 
you what value to set by default.

Il giorno lunedì 16 ottobre 2017 05:05:15 UTC+2, Tom Tanner ha scritto:
>
> Here's what my Mezzanine theme's `models.py` looks like.
>
> from __future__ import unicode_literals
>
>
> from django.db import models
> from django.core.urlresolvers import reverse
> from django.utils.translation import ugettext_lazy as _
>
>
> from mezzanine.conf import settings
> from mezzanine.core.fields import FileField, RichTextField
> from mezzanine.core.models import Displayable, Ownable, RichText, Slugged
> from mezzanine.generic.fields import CommentsField, RatingField
> from mezzanine.utils.models import AdminThumbMixin, upload_to
> from mezzanine.forms.models import Form
>
>
> class AboutPage(Form):
>  '''
>  All-in-one about page
>  '''
>
>
>  site_description= RichTextField(_("About"), help_text=_("A short 
> description of this website."))
>
>
>  class Meta:
>  verbose_name=_("About page")
>  verbose_name_plural=_("About pages")
>
> When I run `python manage.py makemigrations`, I get this message.
>
> You are trying to add a non-nullable field 'form_ptr' to aboutpage without 
> a default; we can't do that (the database needs something to populate 
> existing rows).
> Please select a fix:
>  1) Provide a one-off default now (will be set on all existing rows with a 
> null value for this column)
>  2) Quit, and let me add a default in models.py
> Select an option: 2
>
>
> How do I change my `AboutPage` class to avoid this message? 
>
> My goal is to make a page that where I can put a form with descriptions 
> and other info for my site. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.