Esempio n. 1
0
def serialize_fully():
    index = 0

    while index < len(serialize_me):
        for field in get_fields(serialize_me[index]):
            if isinstance(field, models.ForeignKey):
                add_to_serialize_list(
                    [serialize_me[index].__getattribute__(field.name)])

        index += 1

    serialize_me.reverse()
Esempio n. 2
0
def serialize_fully():
    index = 0

    while index < len(serialize_me):
        for field in get_fields(serialize_me[index]):
            if isinstance(field, models.ForeignKey):
                add_to_serialize_list(
                    [serialize_me[index].__getattribute__(field.name)])

        index += 1

    serialize_me.reverse()
Esempio n. 3
0
    def test_get_fields(self):
        obj = lambda: None
        obj._meta = lambda: None
        obj._meta.fields = ['foo']

        self.assertEqual(['foo'], get_fields(obj))
    def test_get_fields(self):
        obj = lambda: None
        obj._meta = lambda: None
        obj._meta.fields = ['foo']

        self.assertEqual(['foo'], get_fields(obj))