Skip to content

Instantly share code, notes, and snippets.

View varqasim's full-sized avatar
🖥️

Qasim Albaqali varqasim

🖥️
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RandomNameGeneratorLibrary;
namespace VDBCore
{
public class Flight
@varqasim
varqasim / models.py
Created August 22, 2015 18:17
Uploading multiple images in Django using Fromset(modelformset_factory). Read more on my blogpost http://qasimalbaqali.com/uploading-multiple-images-in-django-for-a-single-post/
class PostForm(forms.ModelForm):
title = forms.CharField(max_length=128)
body = forms.CharField(max_length=245, label="Item Description.")
class Meta:
model = Post
fields = ('title', 'body', )
class ImageForm(forms.ModelForm):
@varqasim
varqasim / index.html
Last active August 29, 2015 14:27
How a template would look like when using two models in a Django ListView http://stackoverflow.com/questions/12187751/django-pass-multiple-models-to-one-template
{% for post in posts %}
<a href="{% url 'post' post_name_slug=post.slug %}"></a>
{% endfor %}
{% for post_comments in comments %}
{{ post_comments }}
{% endfor %}