Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-27 Thread Patrick Carra
okay so I dumped all the contents of my editCircuit.html into a file called 
circuitinfotable_form.html and now I get my form.  But I still don't 
understand why I had to use this name since I never specified it anywhere.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4419ba31-8535-4723-9c61-3627faadf9bb%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-27 Thread Patrick Carra
I don't have a circuitinfotable_form.html.  I never specified 
circuitinfotable_form in any of my code.  What should that form contain?  
My /viewLit/editCircuit.html form contains the following:




{% block content %}


{% csrf_token %}
{{form.as_p}}





{% endblock %}



Shouldn't that suffice for the template form?  What is calling the 
circuitinfotable_form.html?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a06f82fb-0920-4e76-b0cb-027cda1ced92%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-27 Thread franz ulenaers

put your template |'circuitinfotable_form.html' |on one of your folders :|
/home/db_user/ciopsdb/base/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/editLit/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/viewLit/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/searchLit/templates/viewLit/circuitinfotable_form.html
/home/db_user/ciopsdb/homepage/templates/viewLit/circuitinfotable_form.html

|

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2085c566-0c3e-afe1-b232-7bab5af142bf%40gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-27 Thread Patrick Carra
I didn't have one.  I thought UpdateView would create the form for me.  But 
I was working the problem and made one:
from django.forms import ModelForm
from . models import Circuitinfotable

class CircuitinfotableForm(ModelForm):
class Meta:
model = Circuitinfotable
fields = '__all__'


So I also changed my view:
class editLit(UpdateView):
pk_url_kwarg = 'circuitid'
model=Circuitinfotable
form_class= CircuitinfotableForm
template="/viewLit/editCircuit.html"
#fields='__all__'




-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cdbc9127-6a2f-4022-bbda-dfec83101834%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-27 Thread Raja Sekar Sambath
Hey Patrick,

Can you post forms.py here?

On Wed, 27 Nov 2019 at 21:23, Patrick Carra  wrote:

> Raja that was a great suggestion thank you!  Once a started playing around
> with the urls in the project level I found that it was still being routed
> to viewLit despite the edit/ in the url I was passing.  I decided to put
> all these classes into the same app viewLit/views.py and now my parameter
> is correct.
>
> *SELECT* ••• *FROM* "circuitinfotable" *WHERE* "circuitinfotable".
> "circuitid" = 'STTK-100G-18040-01-WRBB'
>
> The problem I am now having is that UpdateView cannot find the template
> circuitinfotable_form.html
> Environment:
>
>
> Request Method: GET
> Request URL: http://98.8.61.133:8080/viewLit/STTK-100G-18040-01-WRBB/edit
>
> Django Version: 2.2.4
> Python Version: 3.6.8
> Installed Applications:
> ['editLit.apps.EditlitConfig',
>  'viewLit.apps.ViewlitConfig',
>  'searchLit.apps.SearchlitConfig',
>  'homepage.apps.HomepageConfig',
>  'base.apps.BaseConfig',
>  'django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'debug_toolbar']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'debug_toolbar.middleware.DebugToolbarMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
> Template loader postmortem
> Django tried loading these templates, in this order:
>
> Using engine django:
> * django.template.loaders.filesystem.Loader:
> /home/db_user/ciopsdb/base/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
> * django.template.loaders.filesystem.Loader:
> /home/db_user/ciopsdb/templates/viewLit/circuitinfotable_form.html (Source
> does not exist)
> * django.template.loaders.app_directories.Loader:
> /home/db_user/ciopsdb/editLit/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> /home/db_user/ciopsdb/viewLit/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> /home/db_user/ciopsdb/searchLit/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> /home/db_user/ciopsdb/homepage/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> /home/db_user/ciopsdb/base/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> /home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/contrib/admin/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> /home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/contrib/auth/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> /home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/debug_toolbar/templates/viewLit/circuitinfotable_form.html
> (Source does not exist)
>
>
>
> Traceback:
>
> File
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py"
> in inner
>   34. response = get_response(request)
>
> File
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/base.py"
> in _get_response
>   145. response = 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
>   143. response = response.render()
>
> File
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py"
> in render
>   106. self.content = self.rendered_content
>
> File
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py"
> in rendered_content
>   81. template = self.resolve_template(self.template_name)
>
> File
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py"
> in resolve_template
>   63. return select_template(template, using=self.using)
>
> File
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/loader.py"
> in select_template
>   47. raise TemplateDoesNotExist(', '.join(template_name_list),
> chain=chain)
>
> Exception Type: TemplateDoesNotExist at
> /viewLit/STTK-100G-18040-01-WRBB/edit
> Exception Value: viewLit/circuitinfotable_form.html
>
>
> My viewLit/models.py is:
> class 

Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-27 Thread Patrick Carra
Raja that was a great suggestion thank you!  Once a started playing around 
with the urls in the project level I found that it was still being routed 
to viewLit despite the edit/ in the url I was passing.  I decided to put 
all these classes into the same app viewLit/views.py and now my parameter 
is correct.

*SELECT* ••• *FROM* "circuitinfotable" *WHERE* "circuitinfotable".
"circuitid" = 'STTK-100G-18040-01-WRBB'

The problem I am now having is that UpdateView cannot find the template 
circuitinfotable_form.html
Environment:


Request Method: GET
Request URL: http://98.8.61.133:8080/viewLit/STTK-100G-18040-01-WRBB/edit

Django Version: 2.2.4
Python Version: 3.6.8
Installed Applications:
['editLit.apps.EditlitConfig',
 'viewLit.apps.ViewlitConfig',
 'searchLit.apps.SearchlitConfig',
 'homepage.apps.HomepageConfig',
 'base.apps.BaseConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'debug_toolbar']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Template loader postmortem
Django tried loading these templates, in this order:

Using engine django:
* django.template.loaders.filesystem.Loader: 
/home/db_user/ciopsdb/base/templates/viewLit/circuitinfotable_form.html 
(Source does not exist)
* django.template.loaders.filesystem.Loader: 
/home/db_user/ciopsdb/templates/viewLit/circuitinfotable_form.html (Source 
does not exist)
* django.template.loaders.app_directories.Loader: 
/home/db_user/ciopsdb/editLit/templates/viewLit/circuitinfotable_form.html 
(Source does not exist)
* django.template.loaders.app_directories.Loader: 
/home/db_user/ciopsdb/viewLit/templates/viewLit/circuitinfotable_form.html 
(Source does not exist)
* django.template.loaders.app_directories.Loader: 
/home/db_user/ciopsdb/searchLit/templates/viewLit/circuitinfotable_form.html 
(Source does not exist)
* django.template.loaders.app_directories.Loader: 
/home/db_user/ciopsdb/homepage/templates/viewLit/circuitinfotable_form.html 
(Source does not exist)
* django.template.loaders.app_directories.Loader: 
/home/db_user/ciopsdb/base/templates/viewLit/circuitinfotable_form.html 
(Source does not exist)
* django.template.loaders.app_directories.Loader: 
/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/contrib/admin/templates/viewLit/circuitinfotable_form.html
 
(Source does not exist)
* django.template.loaders.app_directories.Loader: 
/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/contrib/auth/templates/viewLit/circuitinfotable_form.html
 
(Source does not exist)
* django.template.loaders.app_directories.Loader: 
/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/debug_toolbar/templates/viewLit/circuitinfotable_form.html
 
(Source does not exist)



Traceback:

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py"
 
in inner
  34. response = get_response(request)

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/base.py"
 
in _get_response
  145. response = 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
  143. response = response.render()

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py"
 
in render
  106. self.content = self.rendered_content

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py"
 
in rendered_content
  81. template = self.resolve_template(self.template_name)

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/response.py"
 
in resolve_template
  63. return select_template(template, using=self.using)

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/template/loader.py"
 
in select_template
  47. raise TemplateDoesNotExist(', '.join(template_name_list), 
chain=chain)

Exception Type: TemplateDoesNotExist at 
/viewLit/STTK-100G-18040-01-WRBB/edit
Exception Value: viewLit/circuitinfotable_form.html


My viewLit/models.py is:
class Circuitinfotable(models.Model):
id1 = models.IntegerField(blank=True,null=True)
pid = models.CharField(max_length=255, blank=True, null=True)
circuitid = models.CharField(primary_key=True, max_length=255, 
blank=True, null=False)
bandwidth = models.CharField(max_length=255, blank=True, 

Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Raja Sekar Sambath
Hi,
   * path('viewLit/edit/', include('editLit.urls')),*
path('viewLit/', include('viewLit.urls')),
  *  path('edit/', include('editLit.urls'))*,

look at above in project level urls.py, give a try by commenting any one

On Wed, 27 Nov 2019 at 03:30, Patrick Carra  wrote:

> It's actually this I copy and pasted the wrong thing:
>
>  ="edit-item" title="Edit">Edit Circuit Info
>
>
>
> My project level urls.py is:
>
> from django.contrib import admin
> from django.urls import path, include
> from django.conf.urls import url
> import debug_toolbar
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('', include('homepage.urls')),
> path('searchlit/', include('searchLit.urls')),
> path('viewLit/edit/', include('editLit.urls')),
> path('viewLit/', include('viewLit.urls')),
> path('edit/', include('editLit.urls')),
> path(r'^__debug__/', include(debug_toolbar.urls)),
> ]
>
> So, *editLit.urls* will be:
>
> [...]
> urlpatterns = [
> [...]
>  path('circuit/',
> views.editLit.as_view(),name='editLit'),
> []
>
> ]
>
> But it doesn't work it gives me the same error:
>
> *SELECT* ••• *FROM* "circuitinfotable" *WHERE* "circuitinfotable"."circuitid"
> = 'edit/circuit/STTK-100G-18040-01-WRBB'
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a4e4c292-11cb-443f-8a2a-bcb91053f6f1%40googlegroups.com
> 
> .
>


-- 
Thanks & Regards,

Raja Sekar Sampath
+91 9087434567.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAS5AE7dSUbwB9bWsFENcB4gcXa_vDpybcbM3OLtye5O9nrc9w%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
It's actually this I copy and pasted the wrong thing:

Edit Circuit Info



My project level urls.py is:

from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
import debug_toolbar

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('homepage.urls')),
path('searchlit/', include('searchLit.urls')),
path('viewLit/edit/', include('editLit.urls')),
path('viewLit/', include('viewLit.urls')),
path('edit/', include('editLit.urls')),
path(r'^__debug__/', include(debug_toolbar.urls)),
]

So, *editLit.urls* will be:

[...]
urlpatterns = [
[...]
 path('circuit/', 
views.editLit.as_view(),name='editLit'),
[]

]

But it doesn't work it gives me the same error:

*SELECT* ••• *FROM* "circuitinfotable" *WHERE* "circuitinfotable"."circuitid" 
= 'edit/circuit/STTK-100G-18040-01-WRBB'

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a4e4c292-11cb-443f-8a2a-bcb91053f6f1%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Gil Obradors
This is the link ?
 Edit Jira Info


My project level urls.py is:

from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
import debug_toolbar

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('homepage.urls')),
path('searchlit/', include('searchLit.urls')),
path('viewLit/edit/', include('editLit.urls')),
path('viewLit/', include('viewLit.urls')),
path('edit/', include('editLit.urls')),
path(r'^__debug__/', include(debug_toolbar.urls)),
]

So, *editLit.urls* will be:

[...]
urlpatterns = [
[...]
 path('jira/', views.editLit.as_view(),name='editLit'),
[]

]




Missatge de Patrick Carra  del dia dt., 26 de nov.
2019 a les 22:35:

> Correct me if i'm wrong but I think you meant:
>
> urlpatterns= [
>  path('circuit/',
> views.editLit.as_view(),name='editLit'),
> ]
>
> I did make that change but the results were the same.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/53dd1d57-4465-4af3-9b9e-183a2f9b6913%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTTi%3D1swLbefyCRFAWmdGN8gbHmajKrmVPYSTqvsGzttmQ%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
Ha that was my mistake my brain has turned to mush anyhow the change was 
made and it still is broken :(

On Tuesday, November 26, 2019 at 3:34:45 PM UTC-6, Patrick Carra wrote:
>
> Correct me if i'm wrong but I think you meant:
>
> urlpatterns= [
>  path('circuit/', 
> views.editLit.as_view(),name='editLit'),
> ]
>
> I did make that change but the results were the same.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9bd047f5-0d6f-4197-b699-e92675b9d595%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
Correct me if i'm wrong but I think you meant:

urlpatterns= [
 path('circuit/', 
views.editLit.as_view(),name='editLit'),
]

I did make that change but the results were the same.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53dd1d57-4465-4af3-9b9e-183a2f9b6913%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Gil Obradors
Easy, urlpatterns from  editLit.urls must be:

urlpatterns= [
 path('jira/', views.editLit.as_view(),name='editLit'),
]


Missatge de Patrick Carra  del dia dt., 26 de nov.
2019 a les 22:09:

> Yea! This toolbar is an awesome tool thanks for the tip.  So now I guess
> I'm not understanding how to route url's really.  The a href is:
>   target="blank" title="Edit">Edit Jira Info
>
> My project level urls.py is:
>
> from django.contrib import admin
> from django.urls import path, include
> from django.conf.urls import url
> import debug_toolbar
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('', include('homepage.urls')),
> path('searchlit/', include('searchLit.urls')),
> path('viewLit/edit/', include('editLit.urls')),
> path('viewLit/', include('viewLit.urls')),
> path('edit/', include('editLit.urls')),
> path(r'^__debug__/', include(debug_toolbar.urls)),
> ]
>
> my editLit urls.py is:
> from django.urls import path, include
> from django.conf.urls import  url
> from . import views
>
> urlpatterns= [
>  path('edit/circuit/',
> views.editLit.as_view(),name='editLit'),
> ]
>
>
> And finally my editLit views.py is:
> class editLit(UpdateView):
> pk_url_kwarg = 'circuitid'
> model=Circuitinfotable
> template="/editLit/editCircuit.html"
> fields = '__all__'
>
>
> So I don't understand either how to just pull the param without the
> edit/circuit/ part or can that be stripped before it is passed to the view?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9685efa1-b9b1-46e2-b831-d6144e0ebdf2%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTTMKiT9AOCCQoMEtdC2nA1c7Oa0w%3Dd7_Ny%3DOwJTqgODfw%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
Yea! This toolbar is an awesome tool thanks for the tip.  So now I guess 
I'm not understanding how to route url's really.  The a href is:
 Edit Jira Info

My project level urls.py is:

from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
import debug_toolbar

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('homepage.urls')),
path('searchlit/', include('searchLit.urls')),
path('viewLit/edit/', include('editLit.urls')),
path('viewLit/', include('viewLit.urls')),
path('edit/', include('editLit.urls')),
path(r'^__debug__/', include(debug_toolbar.urls)),
]

my editLit urls.py is:
from django.urls import path, include
from django.conf.urls import  url
from . import views

urlpatterns= [
 path('edit/circuit/', 
views.editLit.as_view(),name='editLit'),
]


And finally my editLit views.py is:
class editLit(UpdateView):
pk_url_kwarg = 'circuitid'
model=Circuitinfotable
template="/editLit/editCircuit.html"
fields = '__all__'


So I don't understand either how to just pull the param without the 
edit/circuit/ part or can that be stripped before it is passed to the view?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9685efa1-b9b1-46e2-b831-d6144e0ebdf2%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Gil Obradors
Yeah!
Can you see the error?
*WHERE* "circuitinfotable"."circuitid" =
'edit/circuit/STTK-100G-18040-01-WRBB'
would be : *WHERE* "circuitinfotable"."circuitid" =
'STTK-100G-18040-01-WRBB'

Link incorrect, or uls pattern incorrect
Edit Circuit Info



Missatge de Patrick Carra  del dia dt., 26 de nov.
2019 a les 21:54:

> I figured out the weirdness with the django-debug-toolbar I wasn't serving
> my static files from the apache/mod_wsgi configuration.  After I figured
> that out this is what I have now:
>
>  QueryTimelineTime (ms)Action
>   +
> 
> *SELECT* ••• *FROM* "circuitinfotable" *WHERE* "circuitinfotable"."circuitid"
> = 'edit/circuit/STTK-100G-18040-01-WRBB'
> 53.76007636826474%
> 2.42 SelExpl
>   +
> 
> *SELECT* ••• *FROM* "circuitinfotable" *LIMIT* 21
> 15.353203224437845%
> 0.69 SelExpl
>   +
> 
> *SELECT* ••• *FROM* "django_session" *WHERE* ("django_session"."expire_date"
> > '2019-11-26T20:52:52.260094+00:00'::timestamptz *AND* 
> > "django_session"."session_key"
> = '0b3x3t7gx8sbl09y5vsbonxtlfmynib4')
> 16.928298684768777%
> 0.76 SelExpl
>   +
> 
> *SELECT* ••• *FROM* "auth_user" *WHERE* "auth_user"."id" = 1
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fbd433a9-bf5d-4ee4-b51c-51efbe110a57%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTRrbOpxQXmWfzSvD1vWsSRWrfGNj3XWuVh4P-5ez%2B60WA%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
I figured out the weirdness with the django-debug-toolbar I wasn't serving 
my static files from the apache/mod_wsgi configuration.  After I figured 
that out this is what I have now:

 QueryTimelineTime (ms)Action
  +  
*SELECT* ••• *FROM* "circuitinfotable" *WHERE* "circuitinfotable"."circuitid" 
= 'edit/circuit/STTK-100G-18040-01-WRBB'
53.76007636826474%
2.42 SelExpl
  +  
*SELECT* ••• *FROM* "circuitinfotable" *LIMIT* 21
15.353203224437845%
0.69 SelExpl
  +  
*SELECT* ••• *FROM* "django_session" *WHERE* ("django_session"."expire_date" 
> '2019-11-26T20:52:52.260094+00:00'::timestamptz *AND* 
> "django_session"."session_key" 
= '0b3x3t7gx8sbl09y5vsbonxtlfmynib4')
16.928298684768777%
0.76 SelExpl
  +  
*SELECT* ••• *FROM* "auth_user" *WHERE* "auth_user"."id" = 1

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fbd433a9-bf5d-4ee4-b51c-51efbe110a57%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Gil Obradors
After the page is loaded, click to SQL queries and paste or make a
screenshot of the content.
In this tab you will see all transactions to DB


Missatge de Patrick Carra  del dia dt., 26 de nov.
2019 a les 19:57:

> Okay I have worked on it I do have the toolbar on there but it's not
> display correctly it shows up at the bottom of each page and looks like
> this:
>
>
>- Hide » 
>-  Versions
>Django 2.2.4 
>-  Time
>CPU: 51.78ms (56.68ms) 
>-  Settings 
>-  Headers 
>-  Request
>index 
>-  SQL
>2 queries in 2.67ms 
>-  Static files
>0 files used 
>-  Templates
>homepage/homepage.html 
>-  Cache
>0 calls in 0.00ms 
>-  Signals
>7 receivers of 12 signals 
>-  Logging
>0 messages 
>- Intercept redirects
>- Profiling
>
> «
> Versions
> [image: loading]
> Time
> [image: loading]
> Settings from ciopsdb.settings
> [image: loading]
> Headers
> [image: loading]
> Request
> [image: loading]
> SQL queries from 1 connection
> [image: loading]
> Static files (134 found, 0 used)
> [image: loading]
> Templates (1 rendered)
> [image: loading]
> Cache calls from 1 backend
> [image: loading]
> Signals
> [image: loading]
> Log messages
> [image: loading]
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/863520f7-65dc-4605-98d9-3d28ec1c6d1f%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTQcwaHmjh97v8zgcwGeetRcceAkn_zOJCKq%3DM8fEuX4AQ%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
Okay I have worked on it I do have the toolbar on there but it's not 
display correctly it shows up at the bottom of each page and looks like 
this:


   - Hide » 
   -  Versions 
   Django 2.2.4 
   -  Time 
   CPU: 51.78ms (56.68ms) 
   -  Settings 
   -  Headers 
   -  Request 
   index 
   -  SQL 
   2 queries in 2.67ms 
   -  Static files 
   0 files used 
   -  Templates 
   homepage/homepage.html 
   -  Cache 
   0 calls in 0.00ms 
   -  Signals 
   7 receivers of 12 signals 
   -  Logging 
   0 messages 
   - Intercept redirects
   - Profiling
   
«
Versions
[image: loading]
Time
[image: loading]
Settings from ciopsdb.settings
[image: loading]
Headers
[image: loading]
Request
[image: loading]
SQL queries from 1 connection
[image: loading]
Static files (134 found, 0 used)
[image: loading]
Templates (1 rendered)
[image: loading]
Cache calls from 1 backend
[image: loading]
Signals
[image: loading]
Log messages
[image: loading]

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/863520f7-65dc-4605-98d9-3d28ec1c6d1f%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Gil Obradors
and
Configuring Internal IPs

The Debug Toolbar is shown only if your IP address is listed in the
INTERNAL_IPS

setting. This means that for local development, you *must* add '127.0.0.1'
to INTERNAL_IPS
;
you’ll need to create this setting if it doesn’t already exist in your
settings module:

INTERNAL_IPS = [
# ...
'127.0.0.1',
# ...]


Missatge de Patrick Carra  del dia dt., 26 de nov.
2019 a les 18:04:

> I installed the django-debug-toolbar but its not doing anything. I
> imported it added it to settings.py installed apps and middleware, added
> the if statement to the project level urls.py and Debug is set to True.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bcc80c18-c3e8-4f29-844e-463014476c1e%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTT7-QN-w-9UDDHC%3DhGQYvswvYJeXHpbHcVn_e5v%3DDSofA%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
I installed the django-debug-toolbar but its not doing anything. I imported 
it added it to settings.py installed apps and middleware, added the if 
statement to the project level urls.py and Debug is set to True.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bcc80c18-c3e8-4f29-844e-463014476c1e%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Gil Obradors
Can you try to add to the view class this argument?

https://docs.djangoproject.com/en/2.2/ref/class-based-views/mixins-single-object/#django.views.generic.detail.SingleObjectMixin.pk_url_kwarg

pk_url_kwarg = 'circuitid'

And check what query is doing with django-debug-toolbar

Missatge de Gil Obradors  del dia dt., 26 de nov.
2019 a les 17:01:

> May be,
>
> Or you aren t querying for circuitid ( by view class code) , normally the
> urls are with the int pk parameter...
> For this, django-debug-toolbar can help to see what are you quering to db,
> i recommend to install and play with this great tool
>
> I will read about, i want to know whats happening
>
>
>
>
> El dt., 26 de nov. 2019, 16:47, Patrick Carra  va
> escriure:
>
>> Could it possibly be that it is trying to match this entire value?
>> /viewLit/edit/circuit/STTK-100G-18040-01-WRBB/ and if so what am I doing
>> wrong in my urls and views that I am not dropping /viewLit/edit/circuit/?
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/0f2a1551-27b4-42c0-b251-e17dcb264ab2%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTTOwuvpLG2M_C2wg3bH5Zuy0_hjApakBwtDpE43OSNmPA%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Gil Obradors
May be,

Or you aren t querying for circuitid ( by view class code) , normally the
urls are with the int pk parameter...
For this, django-debug-toolbar can help to see what are you quering to db,
i recommend to install and play with this great tool

I will read about, i want to know whats happening




El dt., 26 de nov. 2019, 16:47, Patrick Carra  va
escriure:

> Could it possibly be that it is trying to match this entire value?
> /viewLit/edit/circuit/STTK-100G-18040-01-WRBB/ and if so what am I doing
> wrong in my urls and views that I am not dropping /viewLit/edit/circuit/?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0f2a1551-27b4-42c0-b251-e17dcb264ab2%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTSvEm86x4hKPXcGNzWstyvQvjHPyOWh6-_JtCJEn%2BrLyw%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
Could it possibly be that it is trying to match this entire value? 
/viewLit/edit/circuit/STTK-100G-18040-01-WRBB/ and if so what am I doing 
wrong in my urls and views that I am not dropping /viewLit/edit/circuit/?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0f2a1551-27b4-42c0-b251-e17dcb264ab2%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-26 Thread Patrick Carra
Thanks for the reply Gil i did this and was able to find this object.

Python 3.6.8 (default, Aug  7 2019, 17:28:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from editLit.models import Circuitinfotable
>>> obj = Circuitinfotable.objects.all()
>>> print(len(obj))
573
>>> obj = Obj.get(circuitid='STTK-100G-18040-01-WRBB')
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'Obj' is not defined
>>> obj = obj.get(circuitid='STTK-100G-18040-01-WRBB')
>>> print(obj)
STTK-100G-18040-01-WRBB

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bbb629de-669c-4edf-a896-4402ee61187c%40googlegroups.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-25 Thread Gil Obradors
Hi!
Matching query doesn't exists says that this entry with this id not exists
in db
Are you sure that this object exists? STTK-100G-18040-01-WRBB

Can you open a shell and:

from xxx.models import Circuitinfotable
obj = Circuitinfotable.objects.all()
print(len(obj))
obj = Obj.get(circuitid='STTK-100G-18040-01-WRBB')
print(obj)


Are you following me?
Or confirm that exists via admin?




Missatge de Patrick Carra  del dia dl., 25 de nov.
2019 a les 22:37:

> Sorry I forgot one! My models.py for this class is below:
>
> class Circuitinfotable(models.Model):
>id1 = models.IntegerField(blank=True, null=True)
>pid = models.CharField(max_length=255, blank=True, null=True)
>circuitid = models.CharField(primary_key=True, max_length=255, blank=
> False, null=False)
>bandwidth = models.CharField(max_length=255, blank=True, null=True)
>region = models.CharField(max_length=255, blank=True, null=True)
>bw = models.IntegerField(blank=True, null=True)
>tableaupathname = models.CharField(max_length=255, blank=True, null=
> True)
>handoffalocaddress = models.CharField(max_length=255, blank=True, null=
> True)
>handoffaloccity = models.CharField(max_length=255, blank=True, null=
> True)
>handoffalocst = models.CharField(max_length=255, blank=True, null=True)
>alocationaddress = models.CharField(max_length=255, blank=True, null=
> True)
>alocationcity = models.CharField(max_length=255, blank=True, null=True)
>alocst = models.CharField(max_length=255, blank=True, null=True)
>handoffzlocaddress = models.CharField(max_length=255, blank=True, null=
> True)
>carrier = models.CharField(max_length=255, blank=True, null=True)
>handoffzloccity = models.CharField(max_length=255, blank=True, null=
> True)
>handoffzlocst = models.CharField(max_length=255, blank=True, null=True)
>zlocationaddress = models.CharField(max_length=255, blank=True, null=
> True)
>zlocationcity = models.CharField(max_length=255, blank=True, null=True)
>zlocst = models.CharField(max_length=255, blank=True, null=True)
>segmentid = models.CharField(max_length=255, blank=True, null=True)
>segmenttype = models.CharField(max_length=255, blank=True, null=True)
>status = models.CharField(max_length=255, blank=True, null=True)
>purpose = models.CharField(max_length=255, blank=True, null=True)
>installdate = models.DateField(blank=True, null=True)
>termdate = models.DateField(blank=True, null=True)
>termlengthmos = models.IntegerField(blank=True, null=True)
>legacy = models.CharField(max_length=255, blank=True, null=True)
>installciopsticket = models.CharField(max_length=255, blank=True, null=
> True)
>retermciopsticket = models.CharField(max_length=255, blank=True, null=
> True)
>discociopsticket = models.CharField(max_length=255, blank=True, null=
> True)
>notes = models.CharField(max_length=255, blank=True, null=True)
>kma = models.CharField(max_length=255, blank=True, null=True)
>group = models.IntegerField(blank=True, null=True)
>cktidkey = models.IntegerField(blank=True, null=True)
>visiolink = models.CharField(max_length=255, blank=True, null=True)
>latestjiraticket = models.CharField(max_length=255, blank=True, null=
> True, unique=True)
>disconnectdate = models.DateField(blank=True, null=True)
>segmentname = models.CharField(max_length=255, blank=True, null=True)
>mrcnew = models.TextField(blank=True, null=True)  # This field type is
> a guess.
>termyrs = models.IntegerField(blank=True, null=True)
>monthbudget = models.IntegerField(blank=True, null=True)
>monthdisco = models.IntegerField(blank=True, null=True)
>mrcold = models.TextField(blank=True, null=True)  # This field type is
> a guess.
>kmz = models.CharField(max_length=255, blank=True, null=True)
>
> class Meta:
>managed = False
>db_table = 'circuitinfotable'
>
> def __str__(self):
>return self.circuitid
>
> def get_absolute_url(self):
>return reverse('home')
>
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b407aac9-aec7-4e45-b91a-9864c4be2d80%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTRKYihP_1DAqOudi5dHfGb5b0pi3%3DtBM04yOZ7-6OoRgA%40mail.gmail.com.


Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-25 Thread Patrick Carra
Sorry I forgot one! My models.py for this class is below:

class Circuitinfotable(models.Model):
   id1 = models.IntegerField(blank=True, null=True)
   pid = models.CharField(max_length=255, blank=True, null=True)
   circuitid = models.CharField(primary_key=True, max_length=255, blank=
False, null=False)
   bandwidth = models.CharField(max_length=255, blank=True, null=True)
   region = models.CharField(max_length=255, blank=True, null=True)
   bw = models.IntegerField(blank=True, null=True)
   tableaupathname = models.CharField(max_length=255, blank=True, null=True)
   handoffalocaddress = models.CharField(max_length=255, blank=True, null=
True)
   handoffaloccity = models.CharField(max_length=255, blank=True, null=True)
   handoffalocst = models.CharField(max_length=255, blank=True, null=True)
   alocationaddress = models.CharField(max_length=255, blank=True, null=True
)
   alocationcity = models.CharField(max_length=255, blank=True, null=True)
   alocst = models.CharField(max_length=255, blank=True, null=True)
   handoffzlocaddress = models.CharField(max_length=255, blank=True, null=
True)
   carrier = models.CharField(max_length=255, blank=True, null=True)
   handoffzloccity = models.CharField(max_length=255, blank=True, null=True)
   handoffzlocst = models.CharField(max_length=255, blank=True, null=True)
   zlocationaddress = models.CharField(max_length=255, blank=True, null=True
)
   zlocationcity = models.CharField(max_length=255, blank=True, null=True)
   zlocst = models.CharField(max_length=255, blank=True, null=True)
   segmentid = models.CharField(max_length=255, blank=True, null=True)
   segmenttype = models.CharField(max_length=255, blank=True, null=True)
   status = models.CharField(max_length=255, blank=True, null=True)
   purpose = models.CharField(max_length=255, blank=True, null=True)
   installdate = models.DateField(blank=True, null=True)
   termdate = models.DateField(blank=True, null=True)
   termlengthmos = models.IntegerField(blank=True, null=True)
   legacy = models.CharField(max_length=255, blank=True, null=True)
   installciopsticket = models.CharField(max_length=255, blank=True, null=
True)
   retermciopsticket = models.CharField(max_length=255, blank=True, null=
True)
   discociopsticket = models.CharField(max_length=255, blank=True, null=True
)
   notes = models.CharField(max_length=255, blank=True, null=True)
   kma = models.CharField(max_length=255, blank=True, null=True)
   group = models.IntegerField(blank=True, null=True)
   cktidkey = models.IntegerField(blank=True, null=True)
   visiolink = models.CharField(max_length=255, blank=True, null=True)
   latestjiraticket = models.CharField(max_length=255, blank=True, null=True
, unique=True)
   disconnectdate = models.DateField(blank=True, null=True)
   segmentname = models.CharField(max_length=255, blank=True, null=True)
   mrcnew = models.TextField(blank=True, null=True)  # This field type is a 
guess.
   termyrs = models.IntegerField(blank=True, null=True)
   monthbudget = models.IntegerField(blank=True, null=True)
   monthdisco = models.IntegerField(blank=True, null=True)
   mrcold = models.TextField(blank=True, null=True)  # This field type is a 
guess.
   kmz = models.CharField(max_length=255, blank=True, null=True)

class Meta:
   managed = False
   db_table = 'circuitinfotable'

def __str__(self):
   return self.circuitid

def get_absolute_url(self):
   return reverse('home')



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b407aac9-aec7-4e45-b91a-9864c4be2d80%40googlegroups.com.


Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-25 Thread Patrick Carra
I have a built a database application that users can search and view 
records from.  I am trying to incorporate an update feature to allow users 
to edit information the app is called editLit.  When I try to pass a 
parameter into the editLit app via urls into views.py I get the following 
error:

Environment:


Request Method: GET
Request URL: http://*:8080/viewLit/edit/circuit/STTK-100G-18040-01-WRBB/

Django Version: 2.2.4
Python Version: 3.6.8
Installed Applications:
['editLit.apps.EditlitConfig',
 'viewLit.apps.ViewlitConfig',
 'searchLit.apps.SearchlitConfig',
 'homepage.apps.HomepageConfig',
 'base.apps.BaseConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py"
 
in inner
  34. response = get_response(request)

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/handlers/base.py"
 
in _get_response
  115. response = 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/ciopsdb/viewLit/views.py" in viewLit
  14. record = Circuitinfotable.objects.get(circuitid=circuitid)

File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/manager.py"
 
in manager_method
  82. 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_name

Exception Type: DoesNotExist at 
/viewLit/edit/circuit/STTK-100G-18040-01-WRBB/
Exception Value: Circuitinfotable matching query does not exist.

My template from which I start in a view app contains the a href link below:


Edit Circuit Info

my editLit.urls.py file contains:
from django.urls import path, include
from django.conf.urls import  url
from . import views

urlpatterns= [
 path('circuit//edit', 
views.editLit.as_view(),name='editLit'),
]


my editLit.views.py file contains:
from django.views.generic.edit import UpdateView

from . models import Circuitinfotable

# Create your views here.
class editLit(UpdateView):
model=Circuitinfotable
template="/editLit/editCircuit.html"
fields = '__all__'


And finally my template for the editLit class is:
{% block content %}


{% csrf_token %}
{{form.as_p}}





{% endblock %}


Any ideas about what I'm doing wrong are welcome I am still new to Django.  
Thanks in advance!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/985bf9e3-fbe4-4604-95db-9ee95ef10809%40googlegroups.com.