class Place(models.Model):
name = models.CharField(
verbose_name=_("name"), max_length=128, blank=True, null=True)
...
class Meta:
abstract = True
ordering = ['-date']
class Hotel(ClusterableModel, Place):
panels = [
MultiFieldPanel(
[
FieldPanel("name"),
...
],
heading="base Options",
),
MultiFieldPanel(
[
FieldPanel("rooms"),
...
InstanceSelectorPanel("city"), <--------------------------------------------------------------
],
heading="Other Options",
),
MultiFieldPanel(
[InlinePanel("images", max_num=10, min_num=1, label="Image")],
heading="Images",
),
]
Thanks.
Hello,
I am using InstanceSelectorPanel to provide a way to add ForeignKey values to a model with search (since the data may be huge later on), also I want to use Orderable to provide images to my model.
Now I have this error:
"<Hotel: Hotel object (None)>" needs to have a value for field "id" before this many-to-many relationship can be used.code:
So is there any possible way I can go around this ?
Thanks.