Ticket #4492: add-quote_name_r5988.diff
File add-quote_name_r5988.diff, 2.9 KB (added by , 17 years ago) |
---|
-
django/db/backends/postgresql/operations.py
105 105 style.SQL_FIELD(qn('id')), 106 106 style.SQL_KEYWORD('IS NOT'), 107 107 style.SQL_KEYWORD('FROM'), 108 style.SQL_TABLE(f.m2m_db_table()))) 109 return output 110 No newline at end of file 108 style.SQL_TABLE(qn(f.m2m_db_table())))) 109 return output -
tests/modeltests/fixtures/fixtures/fixture6.json
1 [ 2 { 3 "pk": "7", 4 "model": "fixtures.mixedcasem2m", 5 "fields": { 6 "relatedItems": [], 7 "Title": "Poker has no place on ESPN" 8 } 9 }, 10 { 11 "pk": "9", 12 "model": "fixtures.mixedcasem2m", 13 "fields": { 14 "relatedItems": [7], 15 "Title": "Time to reform copyright" 16 } 17 } 18 ] -
tests/modeltests/fixtures/models.py
20 20 class Meta: 21 21 ordering = ('-pub_date', 'headline') 22 22 23 class MixedCaseM2M(models.Model): 24 relatedItems = models.ManyToManyField('self', blank=True, null=True) 25 Title = models.CharField(maxlength=100, default='Default title') 26 27 def __unicode__(self): 28 return self.Title 29 30 class Meta: 31 ordering = ('Title',) 32 23 33 __test__ = {'API_TESTS': """ 24 34 >>> from django.core import management 25 35 >>> from django.db.models import get_app … … 75 85 # Dump the current contents of the database as a JSON fixture 76 86 >>> management.call_command('dumpdata', 'fixtures', format='json') 77 87 [{"pk": "3", "model": "fixtures.article", "fields": {"headline": "Time to reform copyright", "pub_date": "2006-06-16 13:00:00"}}, {"pk": "2", "model": "fixtures.article", "fields": {"headline": "Poker has no place on ESPN", "pub_date": "2006-06-16 12:00:00"}}, {"pk": "1", "model": "fixtures.article", "fields": {"headline": "Python program becomes self aware", "pub_date": "2006-06-16 11:00:00"}}] 88 89 # Load fixture 6: a JSON file with mixed-case column names. 90 >>> management.call_command('loaddata', 'fixture6.json', verbosity=0) 91 >>> MixedCaseM2M.objects.all() 92 [<MixedCaseM2M: Poker has no place on ESPN>, <MixedCaseM2M: Time to reform copyright>] 93 >>> mixed = MixedCaseM2M.objects.get(Title__icontains='poker') 94 >>> mixed.relatedItems.all() 95 [<MixedCaseM2M: Time to reform copyright>] 78 96 """} 79 97 80 98 from django.test import TestCase