Re: [mezzanine-users] Re: Subclass model of form page
Here are the docs on creating page subclasses, https://mezzanine.jupo.org/docs/content-architecture.html#creating-custom-content-types. You would need to copy everything you want from Form and add anything extra you need. On Sat, Mar 29, 2014 at 1:00 PM, Cajoline cont...@circonflex.net wrote: Ok thank you, How can I do to create my own page form subclass without error? because I prefer this solution that uses field injection Thank you Le samedi 29 mars 2014 20:37:31 UTC+1, Josh Cartmell a écrit : Yeah, your options are to use field injection or create you own page subclass =) On Sat, Mar 29, 2014 at 12:07 PM, Cajoline con...@circonflex.net wrote: Ok thank you, so if I understand well this is the only way to add a field to form page types? Thank you Le samedi 29 mars 2014 02:37:39 UTC+1, Josh Cartmell a écrit : Hey Cajoline, I would use field injection to add the new fields you want to the current form class, https://mezzanine.jupo.org/doc s/model-customization.html#field-injection On Fri, Mar 28, 2014 at 5:23 PM, Cajoline con...@circonflex.netwrote: I'll rephrase what I'd like to do :) I would like to create my own custom content form page, to add one or two additional fields. I tried to inherit the Page model but I have form fields that appear etc (this is normal) and if I try to inherit the model Form I get an error because apparently I can not get there directly. My question is how can I do to have inherited Page content model with the ability to create form fields and options that exist in the Forms pages thank you, Regards -- 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-use...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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-use...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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. -- 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] Re: Subclass model of form page
Ok thank you, so if I understand well this is the only way to add a field to form page types? Thank you Le samedi 29 mars 2014 02:37:39 UTC+1, Josh Cartmell a écrit : Hey Cajoline, I would use field injection to add the new fields you want to the current form class, https://mezzanine.jupo.org/docs/model-customization.html#field-injection On Fri, Mar 28, 2014 at 5:23 PM, Cajoline con...@circonflex.netjavascript: wrote: I'll rephrase what I'd like to do :) I would like to create my own custom content form page, to add one or two additional fields. I tried to inherit the Page model but I have form fields that appear etc (this is normal) and if I try to inherit the model Form I get an error because apparently I can not get there directly. My question is how can I do to have inherited Page content model with the ability to create form fields and options that exist in the Forms pages thank you, Regards -- 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-use...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- 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] Re: Subclass model of form page
Yeah, your options are to use field injection or create you own page subclass =) On Sat, Mar 29, 2014 at 12:07 PM, Cajoline cont...@circonflex.net wrote: Ok thank you, so if I understand well this is the only way to add a field to form page types? Thank you Le samedi 29 mars 2014 02:37:39 UTC+1, Josh Cartmell a écrit : Hey Cajoline, I would use field injection to add the new fields you want to the current form class, https://mezzanine.jupo.org/ docs/model-customization.html#field-injection On Fri, Mar 28, 2014 at 5:23 PM, Cajoline con...@circonflex.net wrote: I'll rephrase what I'd like to do :) I would like to create my own custom content form page, to add one or two additional fields. I tried to inherit the Page model but I have form fields that appear etc (this is normal) and if I try to inherit the model Form I get an error because apparently I can not get there directly. My question is how can I do to have inherited Page content model with the ability to create form fields and options that exist in the Forms pages thank you, Regards -- 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-use...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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. -- 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] Re: Subclass model of form page
Ok thank you, How can I do to create my own page form subclass without error? because I prefer this solution that uses field injection Thank you Le samedi 29 mars 2014 20:37:31 UTC+1, Josh Cartmell a écrit : Yeah, your options are to use field injection or create you own page subclass =) On Sat, Mar 29, 2014 at 12:07 PM, Cajoline con...@circonflex.netjavascript: wrote: Ok thank you, so if I understand well this is the only way to add a field to form page types? Thank you Le samedi 29 mars 2014 02:37:39 UTC+1, Josh Cartmell a écrit : Hey Cajoline, I would use field injection to add the new fields you want to the current form class, https://mezzanine.jupo.org/ docs/model-customization.html#field-injection On Fri, Mar 28, 2014 at 5:23 PM, Cajoline con...@circonflex.net wrote: I'll rephrase what I'd like to do :) I would like to create my own custom content form page, to add one or two additional fields. I tried to inherit the Page model but I have form fields that appear etc (this is normal) and if I try to inherit the model Form I get an error because apparently I can not get there directly. My question is how can I do to have inherited Page content model with the ability to create form fields and options that exist in the Forms pages thank you, Regards -- 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-use...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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-use...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- 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: Subclass model of form page
I tried to create a subclass of Form model like this: class ContactPage (Page, Form): Representing A page of the home page RichTextField address = (_ ('Info'), null = True, blank = True) class Meta: verbose_name = _ (Form Info) verbose_name_plural = _ (Form Info) But I get the following error: *TypeError: Error When calling the metaclass bases * * Can not create a consistent method resolution * Do you have any idea? thank you Le mercredi 26 mars 2014 20:01:44 UTC+1, Cajoline a écrit : Hello, I would like to create a subclass model of form page, but I can not add custom fields. Create a subclass of a normal page I have no problem but for the form page I can not do it, because the fields to create form is not displayed Would you have an example of a subclass of page form Thank you -- 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] Re: Subclass model of form page
Hi, here it's my custom model https://gist.github.com/anonymous/9840574 for the space between the _ I suppose it's render error of the google group form If you have any idea ? Thank you Le vendredi 28 mars 2014 11:15:49 UTC+1, Luc Milland a écrit : Hello, you should use gist or some other handy way to post your code and post the whole thing, so we don't have to guess the rest. For instance, here you use the _ function which is usually a shortcut for ugettext ( https://docs.djangoproject.com/en/dev/topics/i18n/translation/#standard-translation) . If this is the way you use it, why is there a space between '_' and '(' ? regards, Luc Le vendredi 28 mars 2014 à 01:42 -0700, Cajoline a écrit : I tried to create a subclass of Form model like this: class ContactPage (Page, Form): Representing A page of the home page RichTextField address = (_ ('Info'), null = True, blank = True) class Meta: verbose_name = _ (Form Info) verbose_name_plural = _ (Form Info) But I get the following error: *TypeError: Error When calling the metaclass bases * * Can not create a consistent method resolution * Do you have any idea? thank you Le mercredi 26 mars 2014 20:01:44 UTC+1, Cajoline a écrit : Hello, I would like to create a subclass model of form page, but I can not add custom fields. Create a subclass of a normal page I have no problem but for the form page I can not do it, because the fields to create form is not displayed Would you have an example of a subclass of page form Thank you -- 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] Re: Subclass model of form page
Hey Cajoline, I would use field injection to add the new fields you want to the current form class, https://mezzanine.jupo.org/docs/model-customization.html#field-injection On Fri, Mar 28, 2014 at 5:23 PM, Cajoline cont...@circonflex.net wrote: I'll rephrase what I'd like to do :) I would like to create my own custom content form page, to add one or two additional fields. I tried to inherit the Page model but I have form fields that appear etc (this is normal) and if I try to inherit the model Form I get an error because apparently I can not get there directly. My question is how can I do to have inherited Page content model with the ability to create form fields and options that exist in the Forms pages thank you, Regards -- 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. -- 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.