select records from a model in another django app

2019-07-30 Thread Perceval Maturure
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-us

Re: select records from a model in another django app

2019-07-30 Thread Nitin Kumar
Import another app model. On Tue, 30 Jul, 2019, 4:28 PM Perceval Maturure, 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.

Re: select records from a model in another django app

2019-07-30 Thread John Bagiliko
Import the model from the app of choice and use it as usual. On Tue, Jul 30, 2019, 11:32 AM Nitin Kumar wrote: > Import another app model. > > On Tue, 30 Jul, 2019, 4:28 PM Perceval Maturure, > wrote: > >> i want to display model data using a class based view from another model >> in a differe

Re: select records from a model in another django app

2019-07-30 Thread John Bagiliko
I stand to be corrected On Tue, Jul 30, 2019, 11:53 AM John Bagiliko wrote: > Import the model from the app of choice and use it as usual. > > On Tue, Jul 30, 2019, 11:32 AM Nitin Kumar > wrote: > >> Import another app model. >> >> On Tue, 30 Jul, 2019, 4:28 PM Perceval Maturure, >> wrote: >>

Re: Only for specific region

2019-07-30 Thread Sam W
Use IP2LOCATION to detect the location of the user IP address then you can show pages based on it On Monday, July 29, 2019 at 8:07:07 PM UTC-5, Sebastian Jung wrote: > > Hello, > > I want that my Website only German user can Open it and another User from > Others Region a template Show, that t

Re:

2019-07-30 Thread Suraj Thapa FC
I'm stuck.. If you know anything in the future let me know On Tue, 30 Jul, 2019, 12:10 PM Aldian Fazrihady, wrote: > I see. As Jani has implied, there is currently no idiomatic way to do it. > Here is one way to do it: > https://stackoverflow.com/questions/11529216/django-multiple-file-field > >

Recreating SQL query in ORM

2019-07-30 Thread Jonathan Spicer
Hello, I have an sql query that I would like to recreate using the ORM. Would it be possible for someone to give me some pointers. select count(*) as total, concat(loading_code,code1_code,code2_code,code3_code,code4_code) as seq, concat(loading_id,',',code1_id,'

Re: Recreating SQL query in ORM

2019-07-30 Thread John Bagiliko
Do you want to make this exact query in Django? Then use Your_model.objects.raw("the query here except the last semi colon") On Tue, Jul 30, 2019, 4:56 PM Jonathan Spicer wrote: > Hello, > > I have an sql query that I would like to recreate using the ORM. Would it > be possible for someone to gi

Re: Recreating SQL query in ORM

2019-07-30 Thread Jonathan Spicer
Hello John, I did try that but it complained about the query not containing the primary key. I did wonder if there are methods within the ORM that can replicate it, the tricky part being creating a value to group by from concatenated rows. On Tuesday, 30 July 2019 19:14:32 UTC+1, John Bagiliko

Re: select records from a model in another django app

2019-07-30 Thread Perceval Maturure
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

Re: Recreating SQL query in ORM

2019-07-30 Thread Yogesh K SonI
yes On Tuesday, July 30, 2019 at 10:26:56 PM UTC+5:30, Jonathan Spicer wrote: > > Hello, > > I have an sql query that I would like to recreate using the ORM. Would it > be possible for someone to give me some pointers. > > select count(*) as total, > > concat(loading_code,code1_c

Problem with migrating a fresh db - jango.db.utils.ProgrammingError: column "structure_depth" specified more than once

2019-07-30 Thread Marius Räsener
Hey everybody, I hope I can somehow give enough informations but also keep it as little as possible. situation is: - existing migrations deleted to reset migrations (existing migrations seem are broken aswell, for a fresh db) - new migrations with makemigrations - migrate fails with: File "/

Re: select records from a model in another django app

2019-07-30 Thread Marius Räsener
Hey Perceval, it seems like you have way too many import statements. something like this should be enough: from django.views.generic import ListView from .models import StaffDetail, PeopleDetail, StudentDetail class ArchivesuploadsListView(ListView): queryset = Archivesuploads.objects.all()

Re:

2019-07-30 Thread Abu Yusuf
Do you try this: https://github.com/Chive/django-multiupload On Mon, Jul 29, 2019 at 6:48 PM Suraj Thapa FC wrote: > How can I create a file field which one can upload Multiple files in it... > > -- > You received this message because you are subscribed to the Google Groups > "Django users" grou