Revision 68129b44

b/snf-cyclades-app/synnefo/api/management/commands/network-list.py
61 61
    )
62 62

  
63 63
    object_class = Network
64
    select_related = []
65
    prefetch_related = ["subnets"]
64 66
    deleted_field = "deleted"
65 67
    user_uuid_field = "userid"
66 68
    astakos_url = ASTAKOS_BASE_URL
b/snf-cyclades-app/synnefo/api/management/commands/port-list.py
49 49
    user_uuid_field = "userid"
50 50
    astakos_url = ASTAKOS_BASE_URL
51 51
    astakos_token = ASTAKOS_TOKEN
52
    prefetch_related = ["ips"]
52 53

  
53
    def get_fixed_ips(ip):
54

  
55
        def labels((a, b)):
56
            return str({"subnet": b, "ip_address": str(a)})
57

  
58
        lista = ip.get_ip_addresses_subnets()
59
        lista = map(labels, lista)
60
        return " ".join(lista)
54
    def get_fixed_ips(port):
55
        return ",".join(port.ips.values_list("address", flat=True))
61 56

  
62 57
    FIELDS = {
63 58
        "id": ("id", "The ID of the port"),
b/snf-cyclades-app/synnefo/logic/management/commands/floating-ip-list.py
41 41
class Command(ListCommand):
42 42
    help = "List Floating IPs"
43 43
    object_class = IPAddress
44
    select_related = ["nic"]
44 45
    deleted_field = "deleted"
45 46
    user_uuid_field = "userid"
46 47
    astakos_url = ASTAKOS_BASE_URL

Also available in: Unified diff