Like many who post here, I'm new to Wagtail and Django.
I'm trying to learn as much as I can from the documentation, the demo project, and this forum; but it seems there's at least one issue that doesn't quite click for me yet.
I'm trying to rebuild a site in Wagtail for a construction company, and in particular I'm working on their "projects". Each project needs to have at least one photo, but as many as they'd like to upload. I've tried using the Adverts and the Carousels in the demo app as inspiration, but a photo field never shows up, much less an orderable photo field.
Here's my code, such as it is:
class ProjectPhotos(models.Model):
photo = models.ForeignKey(
'wagtailimages.Image',
related_name='+'
)
panels = [
ImageChooserPanel('photo')
]
class ProjectPhotoPlacement(Orderable, ProjectPhotos):
project = ParentalKey('home.Project', related_name='project_photos')
@register_snippet
class Project(Orderable, ClusterableModel):
location = models.CharField(max_length=255, help_text="City, State")
footprint = models.CharField(max_length=255, null=True)
duration = models.CharField(max_length=255, null=True)
content_panels = [
InlinePanel('location'),
FieldPanel('footprint'),
FieldPanel('duration'),
InlinePanel('project_photos', label="Project Photos")
]
I've tried just about every combination I could think of. Where am I going off track?