Changes between Version 1 and Version 2 of Ticket #27311
- Timestamp:
- Oct 4, 2016, 5:40:33 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27311 – Description
v1 v2 3 3 {{{ 4 4 def generate_invoices(apps, schema_editor): 5 Payment = apps.get_model('finance', 'Payment')6 Invoice = apps.get_model('finance', 'Invoice')5 A = apps.get_model('app1', 'A') 6 B = apps.get_model('app1', 'B') 7 7 User = apps.get_model('accounts', 'User') 8 8 9 payment = Payment.objects.last()9 a = A.objects.last() 10 10 11 invoice = Invoice(12 client= payment.user),11 b = B( 12 client=a.user), 13 13 status=5 14 14 ) … … 21 21 22 22 {{{ 23 invoice = Invoice(24 client=User.objects.get(pk= payment.user.pk),23 b = B( 24 client=User.objects.get(pk=a.user.pk), 25 25 status=5 26 26 ) … … 30 30 In both cases I get the error: 31 31 {{{ 32 Cannot assign "<User: Some Client>": "Invoice.client" must be a "User" instance.32 Cannot assign "<User: Some User>": "B.client" must be a "User" instance. 33 33 }}}