~julian-edwards/maas/nodegroup-on-bootimage-schema

« back to all changes in this revision

Viewing changes to src/maasserver/tests/models.py

  • Committer: Tarmac
  • Author(s): Raphael Badin
  • Date: 2012-10-19 14:12:29 UTC
  • mfrom: (1287.2.8 bulk-load)
  • Revision ID: tarmac-20121019141229-zqiodlexfafvxxqs
[r=allenap][bug=1066775][author=rvb] Load the mac addresses related to a node from the cache even if .iterator() is used.  Preload the macaddresses and the tags related to a list of nodes when fetching the list of nodes via the api.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from django.db.models import (
19
19
    CharField,
 
20
    ForeignKey,
20
21
    Model,
21
22
    )
22
23
from maasserver.fields import (
23
24
    JSONObjectField,
24
25
    XMLField,
25
26
    )
 
27
from maasserver.models.managers import BulkManager
26
28
from maasserver.models.timestampedmodel import TimestampedModel
27
29
 
28
30
 
53
55
class FieldChangeTestModel(Model):
54
56
    name1 = CharField(max_length=255, unique=False)
55
57
    name2 = CharField(max_length=255, unique=False)
 
58
 
 
59
 
 
60
class BulkManagerParentTestModel(Model):
 
61
    pass
 
62
 
 
63
 
 
64
class BulkManagerTestModel(Model):
 
65
    parent = ForeignKey('BulkManagerParentTestModel', editable=False)
 
66
 
 
67
    objects = BulkManager()