TypeError: field fieldName TypeError
NawafSwe opened this issue · 2 comments
NawafSwe commented
Issue description:
Hello, I am facing an error while using the model baker with a model that has a RichTextField type,
it gives me an error attached below:
Class Example:
from ckeditor.fields import RichTextField
from django.db import models
class Post(models.Model):
description = RichTextField()
description_ar = RichTextField()
Baker Test:
from model_bakery import baker
post = baker.make(Post,description="ABC",description_ar="ABC" )
berinhard commented
Hi, thanks for using model-bakery. As explained in the docs, model bakery only support Django fields. You're trying to use it with a custom field (RichTextField
) from a third party library (ckeditor
), thus, model-bakery won't work out of the box.
If want to, you can define your own function to generate values for this field type and configure model-bakery to use it. Here are the instructions on how to do so.
Closing this issue since this is not a bug.
NawafSwe commented
Thank you very much.