Tuesday, July 30, 2019

Re: select records from a model in another django app

thanks for the response just to be more elaborative, here is my import code and view code. same code is working in the archivesuploads app but when i try to fetch the queryset in the other app it does not return records

#import code
from django.shortcuts import render
from django.shortcuts import render, redirect
from .models import StaffDetail, PeopleDetail, StudentDetail
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.urls import reverse
from django.utils import timezone # to display date and time as per timezone
from django.views.generic import ListView, DetailView, View, TemplateView
from archivesuploads.models import Archivesuploads, Archivetypes, Interests

#view
class ArchivesuploadsListView(ListView):

    context_object_name = 'object_list'
    queryset = Archivesuploads.objects.all()#[:2] add this to limit the number of publications
    template_name = "person.html"

On Tue, Jul 30, 2019 at 1:54 PM John Bagiliko <john.bagiliko@aims-senegal.org> wrote:
I stand to be corrected

On Tue, Jul 30, 2019, 11:53 AM John Bagiliko <john.bagiliko@aims-senegal.org> wrote:
Import the model from the app of choice and use it as usual.

On Tue, Jul 30, 2019, 11:32 AM Nitin Kumar <nitinkumarbnk@gmail.com> wrote:
Import another app model. 

On Tue, 30 Jul, 2019, 4:28 PM Perceval Maturure, <drperceval@gmail.com> wrote:
i want to display  model data using a class based view from another model in a different app.any idead

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5529da22-0981-43ca-a98a-d13edcc5ba94%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKzNicG9paZfyTWFqMD5hNxwrhT-FH1rKFqxA24oj%3DMprzQZtw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAC26BE218VXdczBfrQD4_CWEf-PyTUML-DgjBoTwdH%3DSmAaNkA%40mail.gmail.com.


--
Perceval Maturure
083 303 9423

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFZtZmDqARbLZ%2B-izb0Q0v-84nVLhaPyP_wxB7GSzHjDDp65og%40mail.gmail.com.

No comments:

Post a Comment