Ejemplo n.º 1
0
def dashboard(request):
    if user.is_authenticated:
        contacts = Contact.objects().order_by('-contact_date').filter(
            user_id=request.user.id)

        context = {'contacts': contacts}

        return render(request, 'accounts/dashboard.html', context)
Ejemplo n.º 2
0
    def forwards(self, orm):
        # Contact
        for contact in Contact.objects():
            contact._changed_fields = [
                'tenant', 'creator', 'photo', 'organization', 'subscribers'
            ]
            contact.save()

        # Organization
        for organization in Organization.objects():
            organization._changed_fields = [
                'tenant', 'creator', 'photo', 'subscribers'
            ]
            organization.save()

        # ContactGroup
        for contact_group in ContactGroup.objects():
            contact_group._changed_fields = ['tenant']
            contact_group.save()