the user is able to create a post and it will be shown the in the list. I've also created a users profile/summary page where the user can edit/delete their posts.
Currently, it's showing blank and I'm not quite sure why?Am I supposed to get the instance or is it fine the way it is?
Model
class Aircraft(AircraftModelBase):
user = models.ForeignKey(User)
manufacturer = SortableForeignKey(Manufacturer)
aircraft_type = SortableForeignKey(AircraftType)
View
def upload_overview(request):
uploaded_aircraft = Aircraft.objects.filter(user=request.user)
return render(request,'account/upload_overview.html',{'UploadedAircraft':uploaded_aircraft})
Template
<div class="container">
<div class="row aircraft">
{% if UploadedAircraft %}
{% for upload in UploadedAircraft %}
<div class="col-lg-offset-0 col-md-4 col-sm-3 item">
<div class="box"><a href="{{ upload.aircraft.get_absolute_url }}"><img src="{{ upload.aircraft.image.url }}" width="200px" height="200px" alt="{{ upload.aircraft.title }}"/></a>
<h3 class="name"><a href="{{ upload.aircraft.get_absolute_url }}">{{ upload.aircraft.name }}</a></h3>
</div>
</div>
{% endfor %}
{% else %}
<h2 class="text-center">No uploaded aircraft posts..</h2></div>
{% endif %}
</div>