Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread Patrick Carra
and the actual value is OQYX/173774//ZYO but Django is interpreting it as OQYX/173774/ZYO/ On Thursday, November 14, 2019 at 1:41:35 PM UTC-6, Patrick Carra wrote: > > That is a value from the table in models called Circuitinfotable and the > field it is pulled from is called circuitid. > --

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread DANIEL URBANO DE LA RUA
1. Add an import: from my_app import views >>>>>>> 2. Add a URL to urlpatterns: path('', views.home, name='home') >>>>>>> Class-based views >>>>>>> 1. Add an import: from other_app.views import Home >>>>>>>

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread DANIEL URBANO DE LA RUA
; 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) >>>>>> """ >>>>>> from django.contrib import admin >>>>>> from django.urls import path, include >>>>>> from django.conf.urls import url >>>>>

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread DANIEL URBANO DE LA RUA
th('searchlit/', include('searchLit.urls')), >>>>> path('viewLit/', include('viewLit.urls')), >>>>> ] >>>>> >>>>> >>>>> My viewLit app's urls.py >>>>> >>>>> from django.urls import path, include >

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread DANIEL URBANO DE LA RUA
from django.urls import path, include >>>> from django.conf.urls import url >>>> from . import views >>>> >>>> urlpatterns= [ >>>> path(r'/', views.viewLit, name='viewLit'), >>>> ] >>>> >>>>

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread Patrick Carra
point drops one of the /'s and the result is it cannot find a matching circuitid in the Circuitinfotable during the query. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread Patrick Carra
y viewLit app's urls.py >>>> >>>> from django.urls import path, include >>>> from django.conf.urls import url >>>> from . import views >>>> >>>> urlpatterns= [ >>>> path(r'/', views.viewLit, name

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread DANIEL URBANO DE LA RUA
iewLit app's views.py >>> >>> from django.shortcuts import render >>> from django.http import HttpResponse >>> from django.views.generic import TemplateView >>> >>> from . models import Circuitinfotable, Budgettable, Xcinventorytable >>>

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread DANIEL URBANO DE LA RUA
;> return render(request, template, context) >> >> >> The traceback that I receive as an error: >> >> Traceback:File >> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py" >> in inner 34.

Re: django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread Integr@te System
self.process_exception_by_middleware(e, request)File > "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/base.py" > in _get_response 113. response = wrapped_callback(request, > *callback_args, **callback_kwargs)File > "/home/db_user/cio

Re: Django GIS query on annotated spatial field

2019-11-14 Thread Simon Charette
o one > multipolygon with the following query: > > area = Area.objects.filter(id__in = > area_ids).aggregate(area=Union('geom'))['area']print(area) > > SRID=4326;MULTIPOLYGON (((5.014146 52.371687, 5.013973 52.371632, 5.013238 > 52.37166, 5.012505 52.372437, 5.01294 52.372787, 5.0129

django passing a parameter for a view in a url produces Error: Circuitinfotable matching query does not exist.

2019-11-14 Thread Patrick Carra
return getattr(self.get_queryset(), name)(*args, **kwargs)File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py" in get 408. self.model._meta.object_nameException Type: DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: Circ

Re: Performing a query returns an error

2019-11-13 Thread Patrick Carra
derstand you are relying on unmanaged (Meta.managed=False) > models > to use the ORM to query an externally managed database. > > The part you missed here is that the ORM maps ForeignKey fields to > database columns with > a "_id" suffix by default. In your case that means

Re: Performing a query returns an error

2019-11-13 Thread Simon Charette
Hello Patrick, >From what I understand you are relying on unmanaged (Meta.managed=False) models to use the ORM to query an externally managed database. The part you missed here is that the ORM maps ForeignKey fields to database columns with a "_id" suffix by default. In your ca

Performing a query returns an error

2019-11-13 Thread Patrick Carra
Hello all I am new to django and I am trying to do a query to that will provide me with information from multiple tables I have included my models.py file below: Enter code hclass Circuitinfotable(models.Model): pid = models.CharField(max_length=255, blank=True, null=True) circuitid

Re: Django Query

2019-11-12 Thread Eng. Medson Naftal
Visit this link https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html On Tue, Nov 12, 2019, 18:20 Suraj Thapa FC wrote: > You can simply do this with a single login > > On Tue, 12 Nov 2019, 6:59 pm Deepak Singh, > wrote: > >> I have a

Re: Django Query

2019-11-12 Thread Suraj Thapa FC
You can simply do this with a single login On Tue, 12 Nov 2019, 6:59 pm Deepak Singh, wrote: > I have a survey form for students and teachers. Questions are different > for students and teachers, so I want to provide them with different login. > How do I create different login pages in Django

Django Query

2019-11-12 Thread Deepak Singh
I have a survey form for students and teachers. Questions are different for students and teachers, so I want to provide them with different login. How do I create different login pages in Django that redirect to different pages? And how can I store the students and teachers username and password

Re: Query regarding Jija templates with django project

2019-10-30 Thread 'Amitesh Sahay' via Django users
Hey Red, Thank you for your reply. Your suggestion did the trick. Now I am facing issues with static files, especially for CSS files. There were issues for images files, but I got that rectified. I know that the location that I have mentioned in the HTML pages has the CSS files. Still  I am

RE: Database ORM query Help

2019-10-26 Thread dvdcedar
Thanks for the recommendation. The raw SQL method worked for me. Would be good to know how to accomplish this using the Django ORM query set. Basically I have a list of games, the user may choose to update the name for example and instead of the object being updated a new object is created

Re: Database ORM query Help

2019-10-25 Thread wd
I think you could consider using raw sql, https://docs.djangoproject.com/en/2.2/topics/db/sql/#executing-custom-sql-directly On Fri, Oct 25, 2019 at 7:56 PM Cheda me wrote: > Hey guys, > > I have worked out the SQL query I would like to implement but am currently > struggli

Re: Query regarding Jija templates with django project

2019-10-25 Thread red
Hello, Your views have a 'name' attribute. You can also give a name to an app in the urls.py file of the app, right above your urlpatterns list: app_name = "myappname" urlpatterns = [ path('', views.index, name='index'), path('about', views.about, name='about'), path('blog', views.blog,

Query regarding Jija templates with django project

2019-10-25 Thread 'Amitesh Sahay' via Django users
Hello Team, I am kind of new to software development, and trying to find my feat. I have a queries which could be quite dumb to most of you, but I need to know. As far as I know, we need Jija templates in the HTML files, so that we can assign correct path of the static files. Its a general

Re: Database ORM query Help

2019-10-25 Thread Samiul Sk
Please post the code of Model and explain what do you want as Queryset? On Fri, 25 Oct 2019 at 17:26, Cheda me wrote: > Hey guys, > > I have worked out the SQL query I would like to implement but am currently > struggling to create the Django query. I have been attem

Database ORM query Help

2019-10-25 Thread Cheda me
Hey guys, I have worked out the SQL query I would like to implement but am currently struggling to create the Django query. I have been attempting to use the .aggregate() & Max() methods but cant seem to get the right result. Any help is much appropriated. SELECT temp.* FROM item_detail

Re: how to use django pagination with sql query and not ORM

2019-09-24 Thread Deep Sukhwani
Have you tried using the *.query* on Django's QuerySet (documentation: [1]) For example, if my QuerySet is: *User.objects.filter(username__contains='alpha')* I can obtain the underlying raw SQL Query using: *print(User.objects.filter(username__contains='alpha').query)* *>>&g

how to use django pagination with sql query and not ORM

2019-09-24 Thread leb dev
I now how to use django pagination with ORM django after filtering the required data and put in into *pagination div* *queryset_list = employee.objects.all()* *query=request.GET.get("q")* * if query:* *queryset_list=queryset_list.filter(* * Q(name__icont

Re: how to use sql select query with pyodbc and django ?

2019-09-18 Thread Cornelis Poppema
I am not using pyodbc, but I imagine you should %s instead of ? as parameter marker. mysql-python actually uses python interpolation to build the query instead of simply replacing the ? signs, so pyodbc might do the same. If that's the case, it makes sense the error says there are 0 parameter

how to use sql select query with pyodbc and django ?

2019-09-18 Thread leb dev
=*;' ) query = 'jhon' cursor = conn.cursor() c = cursor.execute('SELECT * FROM Artist where artistName like "%?%"',query) print(c) return render (request,'connect.html',{"c":c}) connect.html == id FolderNumber

Django query set

2019-09-15 Thread Suraj Thapa FC
https://hastebin.com/powupucitu.sql Can anyone convert this into queryset... -- 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

Merging or joining raw query set results.

2019-09-14 Thread ML
Hi, I have a raw query which takes in 4 ids within a for loop. It therefore returns 4 query set results. I put the result of each query set into a dictionary and append it to a list. The result looks something like this: [{'first_name': u'John'}, {'first_name': u'Jack'}, {'first_name': u'Jill

Re: Query help

2019-09-12 Thread Matt
an Api that requires making query for > available flight going to a particular destination, from a particular > city, arrival date & departure date & I got no idea on how to write the > query, Pls can anyone help out thanks > > -- > You received this message because you are

Query help

2019-09-12 Thread Tosin Ayoola
Halo guyz I actually need a little help, I'm working on a airline tickets reservations project using postman Api that requires making query for available flight going to a particular destination, from a particular city, arrival date & departure date & I got no idea on how to write t

Re: Query into Django ORM

2019-09-10 Thread Ronit Mishra
e and one env with one comp_name >> there will be many deploy_details which is in green colour (latest). >> >> in deploy_detail if there is two deploy in one component we will take the >> latest deploy_date. >> >> >> Now please can anyone help me in conver

Re: Query into Django ORM

2019-09-10 Thread N'BE SORO
name and one env with one comp_name > there will be many deploy_details which is in green colour (latest). > > in deploy_detail if there is two deploy in one component we will take the > latest deploy_date. > > > Now please can anyone help me in converting this query into Django OR

Re: how to pass user input into raw sql query ?

2019-09-08 Thread testdevleb
Sent from my Samsung Galaxy smartphone. I tried daniel solution and this was right. -- 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

Re: Page 404 - No Job matches the given query.

2019-09-08 Thread Kean
quest, 'projectdetail.html', {'project': project, > 'expense_list': project.expenses.all()}) > > > Error message: > > Page not found (404) > Request Method: GET > Request URL: http://127.0.0.1:8000/businesslogin/businessadmin/busproject > Raised by:

Re: Page 404 - No Job matches the given query.

2019-09-07 Thread Mclaren Sunday
}) > > > Error message: > > Page not found (404) > Request Method: GET > Request URL: http://127.0.0.1:8000/businesslogin/businessadmin/busproject > Raised by: core.views.project_detail > > No Job matches the given query. > > > > > Please can anyone help,

Re: how to pass user input into raw sql query ?

2019-09-07 Thread Mario R. Osorio
ango project that is connected to sql server database i am > trying to write a *select query * #convert the Django ORM into SQL query > print("sql query = ",FilterQuery.query) > > *select * from table name where filed name = user input * > > > *can anyone hel

Re: User matching query does not exist.

2019-09-07 Thread Gabriel Stone
ter. But >> when i trying login with wrong email address for test i have error "User >> matching query does not exist.". How can i handle this error to convert >> message. I have tried this >> >> try: >> user = User.objects.get(email=email) >>

Re: User matching query does not exist.

2019-09-07 Thread göktürk sığırtmaç
t user according to email. > > user = User.objects.get(email=email) > > > if user is none, i will show message. I will check password after. But > when i trying login with wrong email address for test i have error "User > matching query does not exist.". How can i handl

Re: User matching query does not exist.

2019-09-07 Thread göktürk sığırtmaç
Yes i get name email password in register, i get email and password in login 7 Eylül 2019 Cumartesi 23:47:41 UTC+3 tarihinde Gabriel Stone yazdı: > > In your user creation form did you add an email field?if you did then only > can you query users by their email > > On Sat, Se

Re: User matching query does not exist.

2019-09-07 Thread Gabriel Stone
In your user creation form did you add an email field?if you did then only can you query users by their email On Sat, Sep 7, 2019 at 22:36 göktürk sığırtmaç wrote: > I'm trying get user according to email. > > user = User.objects.get(email=email) > > > if user is none, i wi

User matching query does not exist.

2019-09-07 Thread göktürk sığırtmaç
I'm trying get user according to email. user = User.objects.get(email=email) if user is none, i will show message. I will check password after. But when i trying login with wrong email address for test i have error "User matching query does not exist.". How can i handle this error

Page 404 - No Job matches the given query.

2019-09-07 Thread Kean
': project.expenses.all()}) Error message: Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/businesslogin/businessadmin/busproject Raised by: core.views.project_detail No Job matches the given query. Please can anyone help, with getting the url to connect and resolving

Re: how to pass user input into raw sql query ?

2019-09-07 Thread David Grant
On Sat., Sep. 7, 2019, 8:21 a.m. Daniel Roseman, wrote: > On Friday, 6 September 2019 20:39:58 UTC+1, Bhoopesh sisoudiya wrote: >> >> Hi Lev dev, >> >> Write your query like this >> >> >> sqlRawQuery = "Your query ... Field name= {}&

Re: how to pass user input into raw sql query ?

2019-09-07 Thread Daniel Roseman
On Friday, 6 September 2019 20:39:58 UTC+1, Bhoopesh sisoudiya wrote: > > Hi Lev dev, > > Write your query like this > > > sqlRawQuery = "Your query ... Field name= {}".format (userInput) > > Thanks > Bhoopesh Kumar > > >> >> No. D

Re: how to pass user input into raw sql query ?

2019-09-06 Thread Bhoopesh sisoudiya
Hi Lev dev, Write your query like this sqlRawQuery = "Your query ... Field name= {}".format (userInput) Thanks Bhoopesh Kumar On Fri, Sep 6, 2019, 4:29 PM leb dev wrote: > i have a django project that is connected to sql server database i am > trying to write a *select q

how to pass user input into raw sql query ?

2019-09-06 Thread leb dev
i have a django project that is connected to sql server database i am trying to write a *select query * #convert the Django ORM into SQL query print("sql query = ",FilterQuery.query) *select * from table name where filed name = user input * *can anyone help me with this?

Query into Django ORM

2019-09-05 Thread Amit Samanta
we will take the latest deploy_date. Now please can anyone help me in converting this query into Django ORM and the models Thanks in advance -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

model object query

2019-09-04 Thread Dev Gis
Hi All, How to get the ForeignKey value while querying the model object. I was trying to query a model object "mla" to fetch a specific sets of columns and its working fine but the field ForeignKey "instuid" returning a numeric value instant of actual associated value.

Re: ResultSet with query on multiple models

2019-08-24 Thread Catalina Popescu
it's a great tool for basic > query but I don't figure out how to play with Django to do a query spanning > between a lot of models. > > This is the query I do to display all Animals and their corresponding > Vaccines with Encounter.status 'in-progress' and the Immunizat

Re: ResultSet with query on multiple models

2019-08-24 Thread Benoit Dupont
I think I have figured it out. I have to play with models.Prefetch() to restrict the results from the prefetch_related() Can someone confirm this is the right way to do it ? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To

ResultSet with query on multiple models

2019-08-23 Thread Benoit Dupont
Hello, I've played a lot of time with Django and it's a great tool for basic query but I don't figure out how to play with Django to do a query spanning between a lot of models. This is the query I do to display all Animals and their corresponding Vaccines with Encounter.status 'in-progress

Re: Django sql raw query to queryset

2019-08-23 Thread Suraj Thapa FC
e_review_report LEFT JOIN courses ON course_review_report.cid = >> courses.cid >> >> >> Can anyone pls write the querryset for the above sql query >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" g

Re: Django sql raw query to queryset

2019-08-23 Thread Sipum
yset for the above sql query > > -- > 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+unsubscr...@googlegroups.com. >

Django sql raw query to queryset

2019-08-22 Thread Suraj Thapa FC
SELECT * FROM course_review_report LEFT JOIN courses ON course_review_report.cid = courses.cid Can anyone pls write the querryset for the above sql query -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Django db query

2019-08-22 Thread Suraj Thapa FC
class courses(models.Model): level = ( ('beginner', 'Beginner Level'), ('intermediate', 'Intermediate Level'), ('expert', 'Expert Level'), ('all level', 'All Level'), ) type = ( ('live', 'LIVE'), ('on demand', 'On Demand'), )

Re: Aggregating the results of a .union query without using .raw, is it possible?

2019-08-19 Thread Simon Charette
I'm afraid the ORM doesn't support aggregation over unions yet else I would have expected the following to work. objects = Model.objects querysets = ( objects.filter(city=city).values( 'date', weighted_car_crashes=F('car_crashes') * weight ) for city, weight in weights ) union =

Re: Aggregating the results of a .union query without using .raw, is it possible?

2019-08-19 Thread Jo
My bad, the correct SQL query is this: SELECT "date", sum("car_crashes") FROM ( // String from Python str(aggregated.query) ) as "aggregated" GROUP BY "date" Il giorno lunedì 19 agosto 2019 23:10:47 UTC+2, Jo ha scritto: > >

Aggregating the results of a .union query without using .raw, is it possible?

2019-08-19 Thread Jo
I have a table that looks like this datecar_crashes city 01.01 1 Washington 01.02 4 Washington 01.03 0 Washington 01.04 2 Washington 01.05

Re: Duplicated django_content_type Query

2019-08-16 Thread Simon Charette
vendredi 16 août 2019 07:18:08 UTC-4, Gaurav Ravindra Bole a écrit : > > [image: Screenshot from 2019-08-16 13-47-45.jpg] > > > > How we avoid this Duplicated django_content_type Query > -- You received this message because you are subscribed to the Google Groups

Django 2.2 mongoengine query pagination performance

2019-08-07 Thread Felix Tillyard
Hi, We are facing an issue while upgrading from Django 2.1.10 to 2.2.4. We are using mongoengine (http://mongoengine.org/) to pull some documents from a Mongo database. Following the upgrade performance of this is significantly worse. We ran some profiling using pyspy

Re: Recreating SQL query in ORM

2019-08-01 Thread Jonathan Spicer
gt; Simon > > Le mardi 30 juillet 2019 12:56:56 UTC-4, Jonathan Spicer a écrit : >> >> 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 co

Re: Recreating SQL query in ORM

2019-07-31 Thread Simon Charette
.values() before an annotation of an aggregate function uses the provided columns from grouping. Cheers, Simon Le mardi 30 juillet 2019 12:56:56 UTC-4, Jonathan Spicer a écrit : > > Hello, > > I have an sql query that I would like to recreate using the ORM. Would it > be possible for

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, >

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

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 > b

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: Query questions. Please help me.

2019-07-17 Thread 나르엔
I've solved it like this. Thank you for your help. def get_queryset(self): context = super(SearchListView, self).get_queryset() query = self.request.GET.get('q') selectOptions = self.request.GET.getlist('selectoptions') argument_list = [] for field in selectOptions: argument_list.append( Q

Re: Query questions. Please help me.

2019-07-17 Thread Yoo
ntext = super(SearchListView, self).get_queryset() > query = self.request.GET.get('q') > selectOptions = self.request.GET.getlist('selectoptions') > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from thi

Re: Query questions. Please help me.

2019-07-17 Thread 나르엔
Thank you! That's working! But I think it's just a AND condition. It's embarrassing, but what should I do with the OR conditions? def get_queryset(self): context = super(SearchListView, self).get_queryset() query = self.request.GET.get('q') selectOptions = self.request.GET.getlist

Re: Query questions. Please help me.

2019-07-17 Thread Jani Tiainen
. > > Columns to search for are unknown and have been receiving columns to > search through checkbox in html. > > What should I do? Please teach me. > It's blocked from below. > selectoptions is name in checkbox. > > > --- > def get_queryset(self): >

Query questions. Please help me.

2019-07-17 Thread 나르엔
. --- def get_queryset(self): context = super(SearchListView, self).get_queryset() query = self.request.GET.get('q') selectOptions = self.request.GET.getlist('selectoptions') -- You received this message because you are subscribed to the Google Groups "Django users&q

Django ORM Left Join query

2019-07-01 Thread Razib Hossain Shuvo
('cat__userbudget_set__user').filter(user_id=user_id) Enter code here... But the above query only returns UserCategory that matched with the user_id. But i want the following result. select uc.id as cat_id, uc.user_id cat_user, ub.user_id as budget_user, ub.cat_id as budget_cat from user_categories as uc

Re: Display ManyToManyField value or a select_related query in an html object list

2019-06-24 Thread Ricardo Daniel Quiroga
Hi, model.many_to_many_atribute.all() model.many_to_many_atribute.find(name="carl") El lun., 24 jun. 2019 a las 19:18, Charlotte Wood (< charlotte.w...@epiccharterschools.org>) escribió: > HELP! > > Do ManyToManyFields just not print? > > I see them in my form selection. > > Everything works

Display ManyToManyField value or a select_related query in an html object list

2019-06-24 Thread Charlotte Wood
HELP! Do ManyToManyFields just not print? I see them in my form selection. Everything works fine, but when I try to put the linked item on a list form, i get: project.model.none for the value. I cannot figure out how to make all the values print. HELP! PLEASE!! -- You received this

Re: DRF structure query

2019-06-11 Thread Andréas Kühne
Hi, The way we have structured our application is that we have our models and serializers in different apps, but have one app for the api itself. So all of the urls are in the "api/urls.py" file. We have found that this works great for us. However we don't use routers - instead we just use DRF

DRF structure query

2019-06-11 Thread Dave B
Hi, Being fairly new to DRF, I'm just wondering on the best ways of going about stucturing an api which has man endpoints. Basically is there a good reason not to put different categories of endpoints together in different apps, like the ones for user data, ones for app data etc. And then

Re: Orm Query for this type of situation

2019-06-07 Thread Devender Kumar
on account.contact list which are realted by contact phone no with and calls phone no can any one help writing this query On Thu, Jun 6, 2019 at 7:47 PM Devender Kumar wrote: > Account /Lead Model > account_name > contact m2m realtion > > contact Model > name >

Re: Orm Query for this type of situation

2019-06-06 Thread Devender Kumar
Account /Lead Model account_name contact m2m realtion contact Model name phone No calls Model caller no # person phone no who is calling agent no # person who is picking the call (CRM user) status timestamp duration calls model is populated with

Re: Orm Query for this type of situation

2019-06-06 Thread Chetan Ganji
Right now its an open ended question. If you post code for your models here, someone can help you. On Thu, Jun 6, 2019, 4:38 PM Devender Kumar wrote: > Hi, > I am working on CRM project and stuck with REPORTING part. > > I have Accounts , Lead , contact, Calls ,Concern modules > account/Lead

Orm Query for this type of situation

2019-06-06 Thread Devender Kumar
Hi, I am working on CRM project and stuck with REPORTING part. I have Accounts , Lead , contact, Calls ,Concern modules account/Lead can have multiple contacts contacts have multiple calls and concerns calls have different status like Incoming outgoing missed call etc Question I need to

Error - Cannot query "dgp": Must be "Employee" instance. ( dgp is userName and Employee is Model Name )

2019-05-31 Thread Balaji Shetty
HI I get the error when i enter the records of Profile Model and save it. i get GUI for model. I created group and given access of both model to dgp user. ValueError at /admin/newapp/profile1/ dgp is my user name and Employee is the model name. Can anybody help me in this regards Employee

Re: Query on 2 non related models

2019-05-20 Thread Rafael E. Ferrero
l Cheers! Rafael E. Ferrero El lun., 20 may. 2019 a las 9:12, Ivan Martić () escribió: > Hi guys, hope you can help me. > I have 2 models and i want to make a count query on them. I need a count > on how many articles i have in every category. > > Models: > class Ven

Query on 2 non related models

2019-05-20 Thread Ivan Martić
Hi guys, hope you can help me. I have 2 models and i want to make a count query on them. I need a count on how many articles i have in every category. Models: class Vendors(models.Model): id = models.AutoField(db_column='id', primary_key=True, blank=False, unique=True) name

How to make the mock object iterable ['TypeError: 'Mock' object is not iterable'] Need to Mock the django query that is iterating through for loop

2019-05-08 Thread Shashank Gupta
I am trying to mock the below django query object : 1.) if MyModel.objects.filter(data='some_data').exists(): then 2.) for row in MyModel.objects.filter(ListId=id): I am trying to test below django query inside my method. def my_method(some_parameter

About query strings in urls

2019-05-04 Thread Surajeet Das
I am actually developing an android app which will fetch data using an api . I am trying to pass multiple parameters in the url using query strings, but I am not able concatenate those parameters in the url. eg: U/userapi/?email=abc=bcd I trying to achieve the above example. How do I take

Re: Django How to write Customized Query ( Display Information Departmentwise)

2019-04-23 Thread Gourav Chawla
Balaji Shetty, wrote: > Dear Gaurav Sir > > I am very much thankful to you for your reply to my query. > > My questions is *How can i make the customization in Django Admin Panel > itself to implement necessary logic after user of particular department do > the login.( H

Re: Django How to write Customized Query ( Display Information Departmentwise)

2019-04-22 Thread Balaji Shetty
Dear Gaurav Sir I am very much thankful to you for your reply to my query. My questions is *How can i make the customization in Django Admin Panel itself to implement necessary logic after user of particular department do the login.( How and where to embed proposed Logic T1.objects.filter(user

Re: Django How to write Customized Query ( Display Information Departmentwise)

2019-04-20 Thread Sithembewena L. Dube
> *When User U3 do the login in Admin Panel, He should get only his > Department Records - MECH, , not other department* > > > CaseNumber-- UserCurrent -- UserCurrentDepartment > 31 - U3 - *MECH* > > * 32 - U3 - MECH * > *33 - U3 - MECH* > *

Django How to write Customized Query ( Display Information Departmentwise)

2019-04-20 Thread Gourav Chawla
First of all, use appropriate model fields for linking objects. For example users should be a foreign key to your(or Django's) user table. Then whenever you want to show data on any interface to any user, just filter content/rows by user department. Something like:

Django How to write Customized Query ( Display Information Departmentwise)

2019-04-19 Thread Balaji Shetty
rtment* CaseNumber-- UserCurrent -- UserCurrentDepartment 31 - U3 - *MECH* * 32 - U3 - MECH * *33 - U3 - MECH* *--* *When I create superuser, he has access to all user data.* *But other users U1, U2 and U3 have also access of other users Data.* *So My query is h

Django model field and external SQL query

2019-04-18 Thread aardzhanov
Hello, my friends. I need to connect SQL query and model field as ManyToManyField. For example, models.py: cursor = connections['req'].cursor() query="""SELECT….""" cursor.execute(query) emps = cursor.fetchall() class test(models.Model) name = mo

Django model field and external SQL query

2019-04-18 Thread aardzhanov
Hello, my friends. I need to add in my model ManyToManyField connected to any sql query For example, models.py: cursor = connections['req'].cursor() query="""SELECT….""" cursor.execute(query) emps = cursor.fetchall() class test(models.Model) name = mod

Re: Complex query on inner join - case for __ne?

2019-04-15 Thread nm
;app_bar" ON ( > "app_foo"."id" = "app_bar"."foo_id" > ) > WHERE ( > "app_bar"."attribute_1" <> 1 > AND "app_bar"."attribute_2" = 2 > ) > > However, here's what

Re: Complex query on inner join - case for __ne?

2019-04-12 Thread Michael Thomas
t;> NOT ( >> "app_foo"."id" IN ( >> SELECT >> U1."foo_id" >> FROM "app_bar" U1 >> WHERE U1."attribute_1" = 1 >> ) >> ) >> AND "app_bar"

Re: Complex query on inner join - case for __ne?

2019-04-12 Thread naimur rahman
) > ) > AND "app_bar"."attribute_2" = 2 > ) > > On Fri, Apr 12, 2019 at 6:59 PM Aldian Fazrihady > wrote: > >> What's the result of >> >> print(Foo.objects.exclude(bar__attribute=1).filter( >> bar__attribute_2=2).

Re: Complex query on inner join - case for __ne?

2019-04-12 Thread Michael Thomas
IN ( SELECT U1."foo_id" FROM "app_bar" U1 WHERE U1."attribute_1" = 1 ) ) AND "app_bar"."attribute_2" = 2 ) On Fri, Apr 12, 2019 at 6:59 PM Aldian Fazrihady wrote: > What's th

Re: Complex query on inner join - case for __ne?

2019-04-12 Thread Aldian Fazrihady
What's the result of print(Foo.objects.exclude(bar__attribute=1).filter( bar__attribute_2=2).query) On Fri, 12 Apr 2019, 20:10 Michael Thomas, wrote: > Hello everyone, > > I've run into what I believe is a limitation of the ORM that other people > must be dealing with somehow, but

<    1   2   3   4   5   6   7   8   9   10   >