{
    "user": {
        "username": "{{ username }}",
        "first_name": "{{ user.first_name }}",
        "last_name": "{{ user.last_name }}",
        "id": "{{ user.id }}",
        "email": "{{ user.email }}",
        "business": "{{ user.business }}",
        "groups": [
            {% for group in user.mgroups.all %}
                "{{ group.name }}"
                {% if not forloop.last %},{% endif %}
            {% endfor %}
        ],
        "dr": "{{ user.dr }}",

        {% if user.photo %}
        "photo": "{{ user.photo.id }}",
        {% else %}
        "photo": null,
        {% endif %}

        "photos": [
        {% for photo in user.photos.all %}
            {
                "id": "{{ photo.id }}",
                "hash": "{{ photo.hash }}",
                "img": "{{ photo.img.url }}",
            }
            {% if not forloop.last %},{% endif %}
        {% endfor %}
        ]

    }
}
