Skip to content

Instantly share code, notes, and snippets.

@madhukar93
Last active January 27, 2016 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madhukar93/56e94650d8ef943e9f46 to your computer and use it in GitHub Desktop.
Save madhukar93/56e94650d8ef943e9f46 to your computer and use it in GitHub Desktop.
from django.db import models
from django.db.models import F
class TestModel(models.Model)
uid = models.IntegerField()
big_complicated_name = models.CharField()
TestModel.objects.annotate(name=F('big_complicated_name'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment