Skip to content

Instantly share code, notes, and snippets.

View collinanderson's full-sized avatar

Collin Anderson collinanderson

  • South Bend, Indiana
View GitHub Profile
class Matches(models.Model):
product_one = models.ForeignKey(Product, related_name = 'product_one')
product_two = models.ForeignKey(Product, related_name = 'product_two')
class MatchedProducts(APIView):
def get(self, request, *args, **kwargs):
product_id = kwargs.get('product_id')
matched_ids = []

Fix locale problem

Run the following command

$ update-locale LC_ALL="en_US.UTF-8"

If it failed, you will need to add the following to /var/lib/locales/supported.d/local file

en_US.UTF-8 UTF-8