Open GoogleCodeExporter opened 9 years ago
Please resubmit the patch so that it doesn't reformat/re-style other parts of
the
code e.g.
- def __init__(self, *args, **kwargs):
+ def __init__( self, *args, **kwargs ):
Original comment by mattimus...@gmail.com
on 30 Apr 2009 at 9:19
Oopsala, didn't realize that, sorry. Here you go.
Original comment by Flashing...@gmail.com
on 1 May 2009 at 9:33
Attachments:
This is another approach of the patch, with subclass support.
Subclass works by going through the tree until we reach the real node. It's not
an
efficient method because you have to hit the database lots of times per object.
I
prefer doing something like:
def getRemoteDeviceIterator():
classes = [ RemoteBluetoothDeviceFoundRecord,
RemoteBluetoothDeviceSDP,
RemoteBluetoothDeviceNoSDP,
RemoteBluetoothDeviceSDPTimeout,
RemoteBluetoothDeviceFileTry,
RemoteBluetoothDeviceFilesRejected,
RemoteBluetoothDeviceFilesSuccess
]
a=list()
for b in classes:
a.append(b.objects.filter(agentdevicerecord__commited=False).all())
for clas in a:
for element in clas:
yield element
because the list(QuerySet..)+list(QuerySet...) hits the database when you do
the call
and gets you a lot of stuff in memory.
This patch also adds all the fields that are serializable not just the
local_fields,
fields includes the parent class fields so there's no need for doing the weird
things
from the previous patch.
I've tested the patch on lab, and going to do deployment tomorrow. Wanted to
let you
guys know of it just in case.
Keep the good work,
Manuel
ps: With this patch I'm able to send the subclass and get it deserialized with
django
serializer on the other end. The only thing I need to make sure is that the
ForeignKeys or M2M are there before I call save
Original comment by naranjo....@gmail.com
on 14 Oct 2009 at 1:18
Attachments:
Original issue reported on code.google.com by
Flashing...@gmail.com
on 30 Apr 2009 at 5:48Attachments: