Re: manage.py loaddata: Problem installing fixture... Email matching query does not exist

2022-10-17 Thread Luiz Angelo Daros de Luca
Hello Moritz,

I have good news. I managed to migrate from sqlite3 to postgresql.

You need to apply this patch and load each mailman app individually
because it conflicts with existing objects, truncating the *_profile
tables on the way.

https://gitlab.com/mailman/hyperkitty/-/merge_requests/469

The commit message has a little how-to.

I still haven't tested it on my production server but I might do it soon.

Regards,

Luiz

-- 
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/CAJq09z7ZMFHkUy46b2tJHLcny_bHmMyCfzP%3DCRQwXMgQZzJnzQ%40mail.gmail.com.


Re: manage.py loaddata: Problem installing fixture... Email matching query does not exist

2022-09-27 Thread Luiz Angelo Daros de Luca
Hello Moritz,

I got the same problem doing the same mailman3 migration (but to a postgres 
db).
Do you have a solution?

Regards,

-- 
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/e8afbea0-8517-41ee-94ef-4e893005dae4n%40googlegroups.com.


DoesNotExist at /admin/blog/blog/add/: blog matching query does not exist

2022-09-13 Thread Jaap van Wingerde
Suddenly I can no longer add blogs to Django. Django says 'blog
matching query does not exist'. That seems strange to me because I want
to add something to the database and not request a blog. What could be
going on here?

admin.py:
class blogadmin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
if not change:
obj.added_by_user = request.user.username
obj.ip_added = request.META['REMOTE_ADDR']
if obj.ip_added == '127.0.0.1':
obj.ip_added = request.META['HTTP_X_FORWARDED_FOR']
obj.publish = False
del obj.publish_date
else:
obj.changed_by_user = request.user.username
obj.ip_changed = request.META['REMOTE_ADDR']
if obj.ip_changed == '127.0.0.1':
obj.ip_changed = request.META['HTTP_X_FORWARDED_FOR']
if obj.publish == True:
if not obj.publish_date:
obj.publish_date = obj.datetime_changed
super(blogadmin,self).save_model(request, obj, form, change)

I can add text, photographs etc., but no blogs, changing is ok.

Notifications:
DoesNotExist at /admin/blog/blog/add/

blog matching query does not exist.

Request Method: POST
Request URL:http://127.0.0.1:8001/admin/blog/blog/add/
Django Version: 4.1.1
Exception Type: DoesNotExist
Exception Value:

blog matching query does not exist.

Traceback
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8001/admin/blog/blog/add/

Django Version: 4.1.1
Python Version: 3.10.5
Installed Applications:
['grappelli',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'blog.apps.BlogConfig']
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',
 'django.contrib.admindocs.middleware.XViewMiddleware']

Traceback (most recent call last):
  File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/core/handlers/exception.py",
line 55, in inner response = get_response(request) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/core/handlers/base.py",
line 197, in _get_response response = wrapped_callback(request,
*callback_args, **callback_kwargs) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/contrib/admin/options.py",
line 686, in wrapper return self.admin_site.admin_view(view)(*args,
**kwargs) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/utils/decorators.py",
line 133, in _wrapped_view response = view_func(request, *args,
**kwargs) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/views/decorators/cache.py",
line 62, in _wrapped_view_func response = view_func(request, *args,
**kwargs) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/contrib/admin/sites.py",
line 242, in inner return view(request, *args, **kwargs) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/contrib/admin/options.py",
line 1890, in add_view return self.changeform_view(request, None,
form_url, extra_context) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/utils/decorators.py",
line 46, in _wrapper return bound_method(*args, **kwargs) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/utils/decorators.py",
line 133, in _wrapped_view response = view_func(request, *args,
**kwargs) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/contrib/admin/options.py",
line 1750, in changeform_view return self._changeform_view(request,
object_id, form_url, extra_context) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/contrib/admin/options.py",
line 1802, in _changeform_view self.save_model(request, new_object,
form, not add) File "/var/django/liakoster.nl/blog-1/blog/admin.py",
line 26, in save_model super(blogadmin,self).save_model(request, obj,
form, change) File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/contrib/admin/options.py",
line 1225, in save_model obj.save() File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/db/models/base.py",
line 831, in save self.save_base( File
"/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/db/models/base.py",
line 882, in save_base updated = self._save_table( File
&q

manage.py loaddata: Problem installing fixture... Email matching query does not exist

2022-07-07 Thread Moritz Both

Greetings, 
 I am a mailman3 user and trying to migrate the database from sqlite to 
mysql. I did it like here: 
https://www.rockandnull.com/django-dumpdata/

Basically I exported the data from sqlite using "dumpdate" and try to 
import using "loaddata". I did do "migrate --run-syncdb"

Unfortunatlly I get the error below. I am totally new to django. On the 
mailman3 mailing list, folks pointed me here - this seems to be a django 
issue?

Thank you inadvance for any help.
Moritz

Mailman Core Version GNU Mailman 3.3.5 (Tom Sawyer) 
Mailman Core API Version 3.1 
Mailman Core Python Version 3.8.13 (default, May 19 2022, 15:06:19) 
[GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] 

Traceback (most recent call last): 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py",
 
line 173, in __get__ 
rel_obj = self.field.get_cached_value(instance) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/db/models/fields/mixins.py",
 
line 15, in get_cached_value 
return instance._state.fields_cache[cache_name] 
KeyError: 'starting_email' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
  File "manage.py", line 10, in  
execute_from_command_line(sys.argv) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/core/management/__init__.py",
 
line 419, in execute_from_command_line 
utility.execute() 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/core/management/__init__.py",
 
line 413, in execute 
self.fetch_command(subcommand).run_from_argv(self.argv) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/core/management/base.py",
 
line 354, in run_from_argv 
self.execute(*args, **cmd_options) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/core/management/base.py",
 
line 398, in execute 
output = self.handle(*args, **options) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/core/management/commands/loaddata.py",
 
line 78, in handle 
self.loaddata(fixture_labels) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/core/management/commands/loaddata.py",
 
line 123, in loaddata 
self.load_label(fixture_label) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/core/management/commands/loaddata.py",
 
line 190, in load_label 
obj.save(using=self.using) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/core/serializers/base.py",
 
line 223, in save 
models.Model.save_base(self.object, using=using, raw=True, **kwargs) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/db/models/base.py", 
line 763, in save_base 
pre_save.send( 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/dispatch/dispatcher.py",
 
line 180, in send 
return [ 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/dispatch/dispatcher.py",
 
line 181, in  
(receiver, receiver(signal=self, sender=sender, **named)) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/hyperkitty/signals.py", 
line 96, in Thread_on_pre_save 
kwargs["instance"].on_pre_save() 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/hyperkitty/models/thread.py",
 
line 157, in on_pre_save 
self.find_starting_email() 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/hyperkitty/models/thread.py",
 
line 149, in find_starting_email 
if self.starting_email is not None: 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py",
 
line 187, in __get__ 
rel_obj = self.get_object(instance) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py",
 
line 307, in get_object 
return super().get_object(instance) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py",
 
line 154, in get_object 
return qs.get(self.field.get_reverse_related_filter(instance)) 
  File 
"*/home/daneben/*.local/lib/python3.8/site-packages/django/db/models/query.py", 
line 435, in get 
raise self.model.DoesNotExist( 
hyperkitty.models.email.DoesNotExist: Problem installing fixture 
'/home/daneben/mailman-suite/datadump.json': Email matching query does not 
exist. 

-- 
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/a0a4a372-5270-4e70-9507-a8a6d2df0b04n%40googlegroups.com.


Re: Employee matching query does not exist

2022-01-05 Thread Gwanghyeon Gim
Two possible scenarios.

1. self.request.POST doesn't have any key named 'employee_id', so 
self.request.POST.get('employee_id') returns None
2. self.request.POST.get('employee_id') has value like 'Sam', but Employee 
model doesn't have any object whose name equals to 
self.request.POST.get('employee_id').

On Wednesday, 5 January 2022 at 22:53:30 UTC+9 reyo...@gmail.com wrote:

> Django don't saw a employe who have this ID
>  so you can use filter if there's not matching in your database he return 
> [ ]. 
>
> obj.employee= 
> Employee.objects.filter(name=self.request.POST.get('employee_id'))
>
> Le mardi 4 janvier 2022 à 15:44:55 UTC+1, jitendra...@gmail.com a écrit :
>
>> name column row's data not matching from database
>>
>> Show that you are getting error .
>>
>>
>> So we use the Expection then you can easily handle the error ..
>>
>> On Tue, 4 Jan 2022, 8:05 pm yassin kamanyile,  wrote:
>>
>>> please team ..i  got an error from that line below
>>>
>>> obj.employee = Employee.objects.get(name=self.request.POST.get(
>>> 'employee_id'))
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/0d469b11-33f5-49bb-a984-76f53a2e08c8n%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/a458eed7-ace9-4ff7-9d41-dbf679389144n%40googlegroups.com.


Re: Employee matching query does not exist

2022-01-05 Thread Julio Cojom
Hi,

Try the following.

employee =self.request.POST.get('employee_id')
print(employee)
obj.employee= Employee.objects.filter(name=employee)

It will crash again, but you can see in the console if it's printing the id
correctly.

I've assume this is a function, not a class view by the way that you are
handling the query set. And I believe with the poor information that you
give us, that the 'employee_id' isn't the right keyword to get the value
desired.

Usually you can use the name in your models to refer to the field that you
want the data. If you want the primary key, you should use pk of an
existing record in the database.

Also you can print self.request.POST to see all the data that I has, that
is a dictionary so you can see they keyword you need and the data in brings.

Regards.

Julio Cojom.






El mié., 5 de enero de 2022 7:53 a. m., Rey Ondiyo 
escribió:

> Django don't saw a employe who have this ID
>  so you can use filter if there's not matching in your database he return
> [ ].
>
> obj.employee=
> Employee.objects.filter(name=self.request.POST.get('employee_id'))
>
> Le mardi 4 janvier 2022 à 15:44:55 UTC+1, jitendra...@gmail.com a écrit :
>
>> name column row's data not matching from database
>>
>> Show that you are getting error .
>>
>>
>> So we use the Expection then you can easily handle the error ..
>>
>> On Tue, 4 Jan 2022, 8:05 pm yassin kamanyile,  wrote:
>>
>>> please team ..i  got an error from that line below
>>>
>>> obj.employee = Employee.objects.get(name=self.request.POST.get(
>>> 'employee_id'))
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/0d469b11-33f5-49bb-a984-76f53a2e08c8n%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/7e08fe8e-bd4e-4779-be29-79d5453ea116n%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/CAHRQUH%3D_46u4BugGaX4qaLTOCjsfQA830a6wES8tWFOrALMv_Q%40mail.gmail.com.


Re: Employee matching query does not exist

2022-01-05 Thread Rey Ondiyo
Django don't saw a employe who have this ID
 so you can use filter if there's not matching in your database he return [ 
]. 

obj.employee= 
Employee.objects.filter(name=self.request.POST.get('employee_id'))

Le mardi 4 janvier 2022 à 15:44:55 UTC+1, jitendra...@gmail.com a écrit :

> name column row's data not matching from database
>
> Show that you are getting error .
>
>
> So we use the Expection then you can easily handle the error ..
>
> On Tue, 4 Jan 2022, 8:05 pm yassin kamanyile,  wrote:
>
>> please team ..i  got an error from that line below
>>
>> obj.employee = Employee.objects.get(name=self.request.POST.get(
>> 'employee_id'))
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0d469b11-33f5-49bb-a984-76f53a2e08c8n%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/7e08fe8e-bd4e-4779-be29-79d5453ea116n%40googlegroups.com.


Re: Employee matching query does not exist

2022-01-04 Thread Jitendra kumar Patra
name column row's data not matching from database

Show that you are getting error .


So we use the Expection then you can easily handle the error ..

On Tue, 4 Jan 2022, 8:05 pm yassin kamanyile,  wrote:

> please team ..i  got an error from that line below
>
> obj.employee = Employee.objects.get(name=self.request.POST.get(
> 'employee_id'))
>
> --
> 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/0d469b11-33f5-49bb-a984-76f53a2e08c8n%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/CAOAROfn%2Bd7C4JDSAFZpqoSm2kVxCBL16qdA93PS0oXvRD3-VoA%40mail.gmail.com.


Employee matching query does not exist

2022-01-04 Thread yassin kamanyile
please team ..i  got an error from that line below

obj.employee = Employee.objects.get(name=self.request.POST.get('employee_id'
))

-- 
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/0d469b11-33f5-49bb-a984-76f53a2e08c8n%40googlegroups.com.


Re: User matching query does not exist.

2021-10-18 Thread Nicholas Bartlett
Hi all, I have a similar issue on my DB. 

Internal Server Error: /ms_app/customers/19

Traceback (most recent call last):

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/core/handlers/exception.py",
 
line 47, in inner

response = get_response(request)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/core/handlers/base.py",
 
line 204, in _get_response

response = response.render()

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/response.py",
 
line 105, in render

self.content = self.rendered_content

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/response.py",
 
line 83, in rendered_content

return template.render(context, self._request)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/backends/django.py",
 
line 61, in render

return self.template.render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 170, in render

return self._render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 162, in _render

return self.nodelist.render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 938, in render

bit = node.render_annotated(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 905, in render_annotated

return self.render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/loader_tags.py",
 
line 150, in render

return compiled_parent._render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 162, in _render

return self.nodelist.render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 938, in render

bit = node.render_annotated(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 905, in render_annotated

return self.render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/loader_tags.py",
 
line 62, in render

result = block.nodelist.render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 938, in render

bit = node.render_annotated(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 905, in render_annotated

return self.render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/defaulttags.py",
 
line 211, in render

nodelist.append(node.render_annotated(context))

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 905, in render_annotated

return self.render(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/defaulttags.py",
 
line 305, in render

match = condition.eval(context)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/defaulttags.py",
 
line 889, in eval

return self.value.resolve(context, ignore_failures=True)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/template/base.py",
 
line 698, in resolve

new_obj = func(obj, *arg_vals)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/MSNDashboard/msCentral/mscentral_project/ms_app/templatetags/custom_tags.py",
 
line 8, in is_group

group = Group.objects.get(name=group_name)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/db/models/manager.py",
 
line 85, in manager_method

return getattr(self.get_queryset(), name)(*args, **kwargs)

  File 
"/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/db/models/query.py",
 
line 435, 

Re: User matching query does not exist.

2021-06-12 Thread sachinbg sachin
It means that the data which you are looking for is not exists in that data
base, check properly wether the searching data is exists or not,

Thank you
Sachin b.g

On Sun, 13 Jun, 2021, 6:53 AM Nikeet NA,  wrote:

> There is no user with id 1.
> Wrap this statement inside try catch block :
>user = User.objects.get(id=uid)
>and catch the DoesNotExist exception as except User.DoesNotExist:
>
> On Saturday, 12 June 2021 at 18:13:09 UTC+5:30 shilpa...@gmail.com wrote:
>
>> Environment:
>>
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/addToCart/1
>>
>> Django Version: 3.2.3
>> Python Version: 3.9.1
>> Installed Applications:
>> ['django.contrib.admin',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'MusicalApp.apps.MusicalappConfig',
>>  'CartApp.apps.CartappConfig']
>> 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 (most recent call last):
>>   File
>> "D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\exception.py",
>> line 47, in inner
>> response = get_response(request)
>>   File
>> "D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\base.py", line
>> 181, in _get_response
>> response = wrapped_callback(request, *callback_args,
>> **callback_kwargs)
>>   File "D:\DjangoDemos\CartApp\views.py", line 15, in addToCart
>> user = User.objects.get(id=uid)
>>   File
>> "D:\DjangoDemos\venv\lib\site-packages\django\db\models\manager.py", line
>> 85, in manager_method
>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>   File "D:\DjangoDemos\venv\lib\site-packages\django\db\models\query.py",
>> line 435, in get
>> raise self.model.DoesNotExist(
>>
>> Exception Type: DoesNotExist at /addToCart/1
>> Exception Value: User matching query does not exist.
>>
> --
> 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/1b7cff79-a0eb-4559-ab17-1d9d0f701343n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1b7cff79-a0eb-4559-ab17-1d9d0f701343n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAOs61rz3X4KBT9MJdFOoion0N4UvH0V_YM%3DhQA3DY%2BZzce8o3w%40mail.gmail.com.


Re: User matching query does not exist.

2021-06-12 Thread Nikeet NA
There is no user with id 1.
Wrap this statement inside try catch block :
   user = User.objects.get(id=uid)
   and catch the DoesNotExist exception as except User.DoesNotExist:

On Saturday, 12 June 2021 at 18:13:09 UTC+5:30 shilpa...@gmail.com wrote:

> Environment:
>
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/addToCart/1
>
> Django Version: 3.2.3
> Python Version: 3.9.1
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'MusicalApp.apps.MusicalappConfig',
>  'CartApp.apps.CartappConfig']
> 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 (most recent call last):
>   File 
> "D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\exception.py", 
> line 47, in inner
> response = get_response(request)
>   File 
> "D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\base.py", line 
> 181, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "D:\DjangoDemos\CartApp\views.py", line 15, in addToCart
> user = User.objects.get(id=uid)
>   File 
> "D:\DjangoDemos\venv\lib\site-packages\django\db\models\manager.py", line 
> 85, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File "D:\DjangoDemos\venv\lib\site-packages\django\db\models\query.py", 
> line 435, in get
> raise self.model.DoesNotExist(
>
> Exception Type: DoesNotExist at /addToCart/1
> Exception Value: User matching query does not exist.
>

-- 
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/1b7cff79-a0eb-4559-ab17-1d9d0f701343n%40googlegroups.com.


User matching query does not exist.

2021-06-12 Thread Shilpa Agrawal
Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/addToCart/1

Django Version: 3.2.3
Python Version: 3.9.1
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'MusicalApp.apps.MusicalappConfig',
 'CartApp.apps.CartappConfig']
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 (most recent call last):
  File 
"D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\exception.py", 
line 47, in inner
response = get_response(request)
  File 
"D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\base.py", line 
181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "D:\DjangoDemos\CartApp\views.py", line 15, in addToCart
user = User.objects.get(id=uid)
  File "D:\DjangoDemos\venv\lib\site-packages\django\db\models\manager.py", 
line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "D:\DjangoDemos\venv\lib\site-packages\django\db\models\query.py", 
line 435, in get
raise self.model.DoesNotExist(

Exception Type: DoesNotExist at /addToCart/1
Exception Value: User matching query does not exist.

-- 
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/879bff80-9f96-445c-a46f-7ca28f0c62f4n%40googlegroups.com.


pages.models.vk_ls_product_search.DoesNotExist: vk_ls_product_search matching query does not exist.

2020-10-16 Thread Salima Begum
Hi all,

I have written test case for ProductDetails_ls for views

*views.py*
  ```
class onClickSearch():

def ProductDetails_ls(request, id):
# product_ls = vk_ls_product_search.objects.get(id=id)
product_ls = get_object_or_404(vk_ls_product_search, id=id)
email = request.session.get('email')
return render(request, "productdetails_ls.html", {
'product_ls': product_ls,'msg_count': msg_count_cl(email),
  'time':
settings.SESSION_IDLE_TIMEOUT,
  'name':
first_last_initial(email),
  'fullname':
fullname(email),
  })
```

*urls.py*

*```*
 path('ProductDetails_ls/', views.onClickSearch.ProductDetails_ls,
name='ProductDetails_ls'),
*```*
*test_views.py*

*```*

@pytest.mark.django_db
class TestViews:

def test_product_detail_ls_authenticated(self):
mixer.blend('pages.vk_ls_product_search')
path = reverse('ProductDetails_ls', kwargs={'id': 19})
request = RequestFactory().get(path)
request.user = mixer.blend(vk_customer)

response = onClickSearch.ProductDetails_ls(request, id=19)
print(response)
assert response.status_code == 200
*```*

*Here, I am getting this error please anyone can help me out to solve this
error,*

*```*
=
FAILURES
=
__
TestViews.test_product_detail_ls_authenticated
__

klass = , args = (), kwargs =
{'id': 19}, queryset = ]>

def get_object_or_404(klass, *args, **kwargs):
"""
Use get() to return an object, or raise a Http404 exception if the
object
does not exist.

klass may be a Model, Manager, or QuerySet object. All other passed
arguments and keyword arguments are used in the get() query.

Like with QuerySet.get(), MultipleObjectsReturned is raised if more
than
one object is found.
"""
queryset = _get_queryset(klass)
if not hasattr(queryset, 'get'):
klass__name = klass.__name__ if isinstance(klass, type) else
klass.__class__.__name__
raise ValueError(
"First argument to get_object_or_404() must be a Model,
Manager, "
"or QuerySet, not '%s'." % klass__name
)
try:
>   return queryset.get(*args, **kwargs)

c:\users\user\appdata\local\programs\python\python38\lib\site-packages\django\shortcuts.py:76:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _

self = ]>, args =
(), kwargs = {'id': 19}, clone = , limit = 21, num = 0

def get(self, *args, **kwargs):
"""
Perform the query and return a single object matching the given
keyword arguments.
"""
clone = self._chain() if self.query.combinator else
self.filter(*args, **kwargs)
if self.query.can_filter() and not self.query.distinct_fields:
clone = clone.order_by()
limit = None
if not clone.query.select_for_update or
connections[clone.db].features.supports_select_for_update_with_limit:
limit = MAX_GET_RESULTS
clone.query.set_limits(high=limit)
num = len(clone)
if num == 1:
return clone._result_cache[0]
    if not num:
>   raise self.model.DoesNotExist(
"%s matching query does not exist." %
self.model._meta.object_name
    )
E   pages.models.vk_ls_product_search.DoesNotExist:
vk_ls_product_search matching query does not exist.

c:\users\user\appdata\local\programs\python\python38\lib\site-packages\django\db\models\query.py:415:
DoesNotExist

During handling of the above exception, another exception occurred:

self = 

def test_product_detail_ls_authenticated(self):
mixer.blend('pages.vk_ls_product_search')
path = reverse('ProductDetails_ls', kwargs={'id': 19})
request = RequestFactory().get(path)
request.user = mixer.blend(vk_customer)

>   response = onClickSearch.ProductDetails_ls(request, id=19)

pages\tests\test_views.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
pages\views.py:2795: in ProductDetails_ls
product_ls = get_object_or_404(vk_ls_product_search, id=id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-10-11 Thread dum dum
Hi guys, I solved this problems about week ago.
Turns out that there were conflict of data and codes.
Django sitemap generate something that was not exist.
Such the slug.

Thanks for suggestions and help before.

On Mon, Oct 12, 2020 at 12:41 AM Dvs Khamele  wrote:

> Hi do you hire contract based python/django freelancer?
> We can help you in this and related techincal tasks at fair prices. Reply
> or send email to divy...@pythonmate.com
> Best Regards,
> Divyesh Khamele,
> Pythonmate
>
>
> On Sat, 26 Sep 2020, 11:50 pm Kasper Laudrup, 
> wrote:
>
>> Hi Dum Dum,
>>
>> On 26/09/2020 18.56, dum dum wrote:
>> > I followed the solution on the internet
>> >
>> https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
>> >
>> > image.png
>> > by commented django.contrib.sites. But still got the same error.
>> > Please advise. Thanks
>> >
>>
>> What did you find in your log files?
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
>> .
>>
> --
> 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/CAH9mneXX7KTgV73riW-KxCadhzF8DyYi0-rVxRJa4vJB6af1-w%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3DaXOdGEX2GdddLzewW4yD15XfvcFxD7MKjdWH6JDfZPxQ%40mail.gmail.com.


Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-10-11 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
We can help you in this and related techincal tasks at fair prices. Reply
or send email to divy...@pythonmate.com
Best Regards,
Divyesh Khamele,
Pythonmate


On Sat, 26 Sep 2020, 11:50 pm Kasper Laudrup,  wrote:

> Hi Dum Dum,
>
> On 26/09/2020 18.56, dum dum wrote:
> > I followed the solution on the internet
> >
> https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
> >
> > image.png
> > by commented django.contrib.sites. But still got the same error.
> > Please advise. Thanks
> >
>
> What did you find in your log files?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
> .
>

-- 
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/CAH9mneXX7KTgV73riW-KxCadhzF8DyYi0-rVxRJa4vJB6af1-w%40mail.gmail.com.


Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-27 Thread Kasper Laudrup
On September 27, 2020 7:49:43 AM GMT+02:00, dum dum  wrote:
>[image: image.png]
>
>I was successfully submitted the sitemap in google search console last
>week, and got discovered urls about 960.. But suddenly, when I tried to
>resubmitted sitemap.xml again, I got status "couldn't fetch".
>The problem is that HTTP Error 500 in production.
>
>In local, I can open sitemap.xml normally
>[image: image.png]
>
>
>
>On Sun, Sep 27, 2020 at 12:43 PM dum dum  wrote:
>
>> There is nothing wrong with the rest data in the logs. I found only
>http
>> error 500 when I visited domain.com/sitemap.xml.
>> It's kinda weird though.
>> Hmm.. still figuring out the cause of the problem.
>>
>> Thanks anyway.
>>
>> On Sun, Sep 27, 2020 at 12:40 PM RANGA BHARATH JINKA <
>> bharathjink...@gmail.com> wrote:
>>
>>> Check the whole logs by going up
>>>
>>> On Sun, Sep 27, 2020 at 11:07 AM dum dum  wrote:
>>>
 [image: image.png]
 This is what I got from heroku logs --tail.

 Thanks.

 On Sun, Sep 27, 2020 at 12:30 PM RANGA BHARATH JINKA <
 bharathjink...@gmail.com> wrote:

> Hi,
>
> Run heroku logs --tail in terminal
> All the best
>
> On Sun, Sep 27, 2020 at 10:51 AM dum dum 
>wrote:
>
>> what do you mean "log files"?
>> Is that logs in terminal or ?
>>
>> In my terminal it works normal, no problem at all.
>> in localhost it works normal, but in production I got http error
>500
>> [image: image.png]
>>
>> I'm using heroku.
>>
>> Thanks
>>
>>
>> On Sun, Sep 27, 2020 at 1:20 AM Kasper Laudrup
>
>> wrote:
>>
>>> Hi Dum Dum,
>>>
>>> On 26/09/2020 18.56, dum dum wrote:
>>> > I followed the solution on the internet
>>> >
>>>
>https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
>>> >
>>> > image.png
>>> > by commented django.contrib.sites. But still got the same
>error.
>>> > Please advise. Thanks
>>> >
>>>
>>> What did you find in your log files?
>>>
>>> Kind regards,
>>>
>>> Kasper Laudrup
>>>
>>> --
>>> 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
>>> .
>>>
>> --
>> 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/CANV3w%3Db-z7UV_Qb8TdtS1eczXEJ%3DQJZRm1TuBB095zSPjjUfRw%40mail.gmail.com
>>
>
>> .
>>
>
>
> --
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>
> --
> 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/CAK5m316iSxAL1w-7HnY9qxVDM42t34U5Yn3Ep19fzfaEnOZthQ%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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit

>https://groups.google.com/d/msgid/django-users/CANV3w%3DaiM-_D8U_ns-oJdO7Z5vyfP8AD6B72tB12VABB8NeOPg%40mail.gmail.com

>
 .

>>>
>>>
>>> --
>>> Thanks and Regards
>>>
>>> J. Ranga Bharath
>>> cell: 9110334114
>>>
>>> --
>>> 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/CAK5m314OwG2fuJ5Qg7PAqfKeaXYCwBZcWQMB9w5yzJfFhvKtCw%40mail.gmail.com
>>>

Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-26 Thread dum dum
[image: image.png]

I was successfully submitted the sitemap in google search console last
week, and got discovered urls about 960.. But suddenly, when I tried to
resubmitted sitemap.xml again, I got status "couldn't fetch".
The problem is that HTTP Error 500 in production.

In local, I can open sitemap.xml normally
[image: image.png]



On Sun, Sep 27, 2020 at 12:43 PM dum dum  wrote:

> There is nothing wrong with the rest data in the logs. I found only http
> error 500 when I visited domain.com/sitemap.xml.
> It's kinda weird though.
> Hmm.. still figuring out the cause of the problem.
>
> Thanks anyway.
>
> On Sun, Sep 27, 2020 at 12:40 PM RANGA BHARATH JINKA <
> bharathjink...@gmail.com> wrote:
>
>> Check the whole logs by going up
>>
>> On Sun, Sep 27, 2020 at 11:07 AM dum dum  wrote:
>>
>>> [image: image.png]
>>> This is what I got from heroku logs --tail.
>>>
>>> Thanks.
>>>
>>> On Sun, Sep 27, 2020 at 12:30 PM RANGA BHARATH JINKA <
>>> bharathjink...@gmail.com> wrote:
>>>
 Hi,

 Run heroku logs --tail in terminal
 All the best

 On Sun, Sep 27, 2020 at 10:51 AM dum dum  wrote:

> what do you mean "log files"?
> Is that logs in terminal or ?
>
> In my terminal it works normal, no problem at all.
> in localhost it works normal, but in production I got http error 500
> [image: image.png]
>
> I'm using heroku.
>
> Thanks
>
>
> On Sun, Sep 27, 2020 at 1:20 AM Kasper Laudrup 
> wrote:
>
>> Hi Dum Dum,
>>
>> On 26/09/2020 18.56, dum dum wrote:
>> > I followed the solution on the internet
>> >
>> https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
>> >
>> > image.png
>> > by commented django.contrib.sites. But still got the same error.
>> > Please advise. Thanks
>> >
>>
>> What did you find in your log files?
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
>> .
>>
> --
> 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/CANV3w%3Db-z7UV_Qb8TdtS1eczXEJ%3DQJZRm1TuBB095zSPjjUfRw%40mail.gmail.com
> 
> .
>


 --
 Thanks and Regards

 J. Ranga Bharath
 cell: 9110334114

 --
 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/CAK5m316iSxAL1w-7HnY9qxVDM42t34U5Yn3Ep19fzfaEnOZthQ%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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CANV3w%3DaiM-_D8U_ns-oJdO7Z5vyfP8AD6B72tB12VABB8NeOPg%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Thanks and Regards
>>
>> J. Ranga Bharath
>> cell: 9110334114
>>
>> --
>> 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/CAK5m314OwG2fuJ5Qg7PAqfKeaXYCwBZcWQMB9w5yzJfFhvKtCw%40mail.gmail.com
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the 

Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-26 Thread dum dum
There is nothing wrong with the rest data in the logs. I found only http
error 500 when I visited domain.com/sitemap.xml.
It's kinda weird though.
Hmm.. still figuring out the cause of the problem.

Thanks anyway.

On Sun, Sep 27, 2020 at 12:40 PM RANGA BHARATH JINKA <
bharathjink...@gmail.com> wrote:

> Check the whole logs by going up
>
> On Sun, Sep 27, 2020 at 11:07 AM dum dum  wrote:
>
>> [image: image.png]
>> This is what I got from heroku logs --tail.
>>
>> Thanks.
>>
>> On Sun, Sep 27, 2020 at 12:30 PM RANGA BHARATH JINKA <
>> bharathjink...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Run heroku logs --tail in terminal
>>> All the best
>>>
>>> On Sun, Sep 27, 2020 at 10:51 AM dum dum  wrote:
>>>
 what do you mean "log files"?
 Is that logs in terminal or ?

 In my terminal it works normal, no problem at all.
 in localhost it works normal, but in production I got http error 500
 [image: image.png]

 I'm using heroku.

 Thanks


 On Sun, Sep 27, 2020 at 1:20 AM Kasper Laudrup 
 wrote:

> Hi Dum Dum,
>
> On 26/09/2020 18.56, dum dum wrote:
> > I followed the solution on the internet
> >
> https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
> >
> > image.png
> > by commented django.contrib.sites. But still got the same error.
> > Please advise. Thanks
> >
>
> What did you find in your log files?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
> .
>
 --
 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/CANV3w%3Db-z7UV_Qb8TdtS1eczXEJ%3DQJZRm1TuBB095zSPjjUfRw%40mail.gmail.com
 
 .

>>>
>>>
>>> --
>>> Thanks and Regards
>>>
>>> J. Ranga Bharath
>>> cell: 9110334114
>>>
>>> --
>>> 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/CAK5m316iSxAL1w-7HnY9qxVDM42t34U5Yn3Ep19fzfaEnOZthQ%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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CANV3w%3DaiM-_D8U_ns-oJdO7Z5vyfP8AD6B72tB12VABB8NeOPg%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>
> --
> 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/CAK5m314OwG2fuJ5Qg7PAqfKeaXYCwBZcWQMB9w5yzJfFhvKtCw%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3Dbvmi7m%2BFmqW7uDjtMY-GPGnWsgeQYaoeD9TrziDvJmSg%40mail.gmail.com.


Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-26 Thread RANGA BHARATH JINKA
Check the whole logs by going up

On Sun, Sep 27, 2020 at 11:07 AM dum dum  wrote:

> [image: image.png]
> This is what I got from heroku logs --tail.
>
> Thanks.
>
> On Sun, Sep 27, 2020 at 12:30 PM RANGA BHARATH JINKA <
> bharathjink...@gmail.com> wrote:
>
>> Hi,
>>
>> Run heroku logs --tail in terminal
>> All the best
>>
>> On Sun, Sep 27, 2020 at 10:51 AM dum dum  wrote:
>>
>>> what do you mean "log files"?
>>> Is that logs in terminal or ?
>>>
>>> In my terminal it works normal, no problem at all.
>>> in localhost it works normal, but in production I got http error 500
>>> [image: image.png]
>>>
>>> I'm using heroku.
>>>
>>> Thanks
>>>
>>>
>>> On Sun, Sep 27, 2020 at 1:20 AM Kasper Laudrup 
>>> wrote:
>>>
 Hi Dum Dum,

 On 26/09/2020 18.56, dum dum wrote:
 > I followed the solution on the internet
 >
 https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
 >
 > image.png
 > by commented django.contrib.sites. But still got the same error.
 > Please advise. Thanks
 >

 What did you find in your log files?

 Kind regards,

 Kasper Laudrup

 --
 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
 .

>>> --
>>> 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/CANV3w%3Db-z7UV_Qb8TdtS1eczXEJ%3DQJZRm1TuBB095zSPjjUfRw%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Thanks and Regards
>>
>> J. Ranga Bharath
>> cell: 9110334114
>>
>> --
>> 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/CAK5m316iSxAL1w-7HnY9qxVDM42t34U5Yn3Ep19fzfaEnOZthQ%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANV3w%3DaiM-_D8U_ns-oJdO7Z5vyfP8AD6B72tB12VABB8NeOPg%40mail.gmail.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m314OwG2fuJ5Qg7PAqfKeaXYCwBZcWQMB9w5yzJfFhvKtCw%40mail.gmail.com.


Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-26 Thread dum dum
[image: image.png]
This is what I got from heroku logs --tail.

Thanks.

On Sun, Sep 27, 2020 at 12:30 PM RANGA BHARATH JINKA <
bharathjink...@gmail.com> wrote:

> Hi,
>
> Run heroku logs --tail in terminal
> All the best
>
> On Sun, Sep 27, 2020 at 10:51 AM dum dum  wrote:
>
>> what do you mean "log files"?
>> Is that logs in terminal or ?
>>
>> In my terminal it works normal, no problem at all.
>> in localhost it works normal, but in production I got http error 500
>> [image: image.png]
>>
>> I'm using heroku.
>>
>> Thanks
>>
>>
>> On Sun, Sep 27, 2020 at 1:20 AM Kasper Laudrup 
>> wrote:
>>
>>> Hi Dum Dum,
>>>
>>> On 26/09/2020 18.56, dum dum wrote:
>>> > I followed the solution on the internet
>>> >
>>> https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
>>> >
>>> > image.png
>>> > by commented django.contrib.sites. But still got the same error.
>>> > Please advise. Thanks
>>> >
>>>
>>> What did you find in your log files?
>>>
>>> Kind regards,
>>>
>>> Kasper Laudrup
>>>
>>> --
>>> 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
>>> .
>>>
>> --
>> 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/CANV3w%3Db-z7UV_Qb8TdtS1eczXEJ%3DQJZRm1TuBB095zSPjjUfRw%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>
> --
> 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/CAK5m316iSxAL1w-7HnY9qxVDM42t34U5Yn3Ep19fzfaEnOZthQ%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANV3w%3DaiM-_D8U_ns-oJdO7Z5vyfP8AD6B72tB12VABB8NeOPg%40mail.gmail.com.


Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-26 Thread RANGA BHARATH JINKA
Hi,

Run heroku logs --tail in terminal
All the best

On Sun, Sep 27, 2020 at 10:51 AM dum dum  wrote:

> what do you mean "log files"?
> Is that logs in terminal or ?
>
> In my terminal it works normal, no problem at all.
> in localhost it works normal, but in production I got http error 500
> [image: image.png]
>
> I'm using heroku.
>
> Thanks
>
>
> On Sun, Sep 27, 2020 at 1:20 AM Kasper Laudrup 
> wrote:
>
>> Hi Dum Dum,
>>
>> On 26/09/2020 18.56, dum dum wrote:
>> > I followed the solution on the internet
>> >
>> https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
>> >
>> > image.png
>> > by commented django.contrib.sites. But still got the same error.
>> > Please advise. Thanks
>> >
>>
>> What did you find in your log files?
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
>> .
>>
> --
> 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/CANV3w%3Db-z7UV_Qb8TdtS1eczXEJ%3DQJZRm1TuBB095zSPjjUfRw%40mail.gmail.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m316iSxAL1w-7HnY9qxVDM42t34U5Yn3Ep19fzfaEnOZthQ%40mail.gmail.com.


Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-26 Thread dum dum
what do you mean "log files"?
Is that logs in terminal or ?

In my terminal it works normal, no problem at all.
in localhost it works normal, but in production I got http error 500
[image: image.png]

I'm using heroku.

Thanks


On Sun, Sep 27, 2020 at 1:20 AM Kasper Laudrup 
wrote:

> Hi Dum Dum,
>
> On 26/09/2020 18.56, dum dum wrote:
> > I followed the solution on the internet
> >
> https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r
> >
> > image.png
> > by commented django.contrib.sites. But still got the same error.
> > Please advise. Thanks
> >
>
> What did you find in your log files?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk
> .
>

-- 
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/CANV3w%3Db-z7UV_Qb8TdtS1eczXEJ%3DQJZRm1TuBB095zSPjjUfRw%40mail.gmail.com.


Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-26 Thread Kasper Laudrup

Hi Dum Dum,

On 26/09/2020 18.56, dum dum wrote:

I followed the solution on the internet
https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r

image.png
by commented django.contrib.sites. But still got the same error.
Please advise. Thanks



What did you find in your log files?

Kind regards,

Kasper Laudrup

--
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/ada20960-af21-f42b-700f-40d6c2abccb7%40stacktrace.dk.


Re: domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-26 Thread dum dum
I followed the solution on the internet
https://www.codeproject.com/Questions/5257129/Why-does-my-sitemap-xml-page-return-django-issue-r

[image: image.png]
by commented django.contrib.sites. But still got the same error.
Please advise. Thanks

On Fri, Sep 25, 2020 at 6:25 PM dum dum  wrote:

> I don't understand this.
> In local, when I access 127.0.0.1:8000/sitemap.xml. I can see my xml file.
> But in production
> domain.com/sitemap.xml gave me this HTTP 500 Error. Site matching query
> does not exist.
>
> Anyone experienced this?
> Please help, thanks!
>

-- 
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/CANV3w%3DZrFe28LHQZc4JtnWscZidzdUWwF3UT-01d%3DdZ5d0iXJQ%40mail.gmail.com.


domain/sitemap.xml HTTP Error 500, site matching query does not exist

2020-09-25 Thread dum dum
I don't understand this.
In local, when I access 127.0.0.1:8000/sitemap.xml. I can see my xml file.
But in production
domain.com/sitemap.xml gave me this HTTP 500 Error. Site matching query
does not exist.

Anyone experienced this?
Please help, thanks!

-- 
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/CANV3w%3DaDu2jTz97JnqX1R7MLnbPeZ4bhfsNb%3D90K4cr0tpjmLg%40mail.gmail.com.


XYZModel matching query does not exist

2020-09-15 Thread Jatin Agrawal
I am facing some issues while fixtures loading while running testcases. The 
error is 

app_name.models.company.CompanyModel.DoesNotExist: Problem installing 
fixture '/Users/xyz/Documents/temp/testdir/random/fixtures/product.json': 
XYZModel matching query does not exist.

1. Earlier, there was no issue while loading fixtures.
2. Testcases were running fine.
3. Not all testcases are breaking.
4. Only some testcases are throwing this error.
5. Fixture of XYZModel is valid and tried and tested by using the loaddata 
command.
6. FK of XYZModel instance in product.json is also valid.


Stuck with this problem last few hours.


Any help or suggestions would be appreciated.


Thanks
Jatin Agrawal

-- 
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/73b44bd5-91b1-4105-ba2a-fe65110f06f2n%40googlegroups.com.


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.


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

2019-11-15 Thread DANIEL URBANO DE LA RUA
Nice but i am always with nginx and i dont know if it has the same problem
or not

On Fri, 15 Nov 2019, 18:02 Patrick Carra,  wrote:

> In case anyone is interested I fixed this with some simple regex in my
> view.  I identified the patterns for which apache was removing the // and
> replacing with a single / and then wrote some rules around that and
> replaced the single / with the // before passing it to my 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2752a54f-4bdc-4781-b8ba-a842ffcb1a36%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/CAO_yRT0DwkcXvukvRWmhOyV5km%3Dn75d7Ssg_UakUktQCGDggdA%40mail.gmail.com.


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

2019-11-15 Thread Patrick Carra
In case anyone is interested I fixed this with some simple regex in my 
view.  I identified the patterns for which apache was removing the // and 
replacing with a single / and then wrote some rules around that and 
replaced the single / with the // before passing it to my 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2752a54f-4bdc-4781-b8ba-a842ffcb1a36%40googlegroups.com.


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
Or send it as a post and finish your problem

On Thu, 14 Nov 2019, 21:59 DANIEL URBANO DE LA RUA, <
dannybombas...@gmail.com> wrote:

> Yes at the moment because is all related to the slash character
>
> On Thu, 14 Nov 2019, 21:57 Patrick Carra,  wrote:
>
>> Yea I think what I may have to do is write some regex in the template to
>> catch anytime there is a // and convert it to something that won't
>> interfere with the apache/mod_wsgi due to the url and then when I pass it
>> back into my view convert it back to the original in order to perform the
>> query and get the correct response.
>>
>> --
>> 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/fa54b31d-c8b6-4900-93d7-e03d8f7ab6c6%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/CAO_yRT0DqfjcA4PNNRACcAVGc7FRitRXeTZJOTRnMdyvUy%3DOSw%40mail.gmail.com.


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
Yes at the moment because is all related to the slash character

On Thu, 14 Nov 2019, 21:57 Patrick Carra,  wrote:

> Yea I think what I may have to do is write some regex in the template to
> catch anytime there is a // and convert it to something that won't
> interfere with the apache/mod_wsgi due to the url and then when I pass it
> back into my view convert it back to the original in order to perform the
> query and get the correct response.
>
> --
> 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/fa54b31d-c8b6-4900-93d7-e03d8f7ab6c6%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/CAO_yRT2mpsCdsWLTaRbPq%3D0WFqMq96ur8SMYBTtHKHVXNHsaQg%40mail.gmail.com.


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
Yea I think what I may have to do is write some regex in the template to 
catch anytime there is a // and convert it to something that won't 
interfere with the apache/mod_wsgi due to the url and then when I pass it 
back into my view convert it back to the original in order to perform the 
query and get the correct response.

-- 
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/fa54b31d-c8b6-4900-93d7-e03d8f7ab6c6%40googlegroups.com.


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
>>> r.encoding
'utf-8'
>>> r.encoding = 'ISO-8859-1'

r is your request use different encoding

El jue., 14 nov. 2019 a las 21:29, DANIEL URBANO DE LA RUA (<
dannybombas...@gmail.com>) escribió:

> https://www.webforefront.com/django/regexpdjangourls.html?
> is maybe something related to your url pattern i don't know but something
> is wrong because is not working  or did you found a solutions?
>
> El jue., 14 nov. 2019 a las 21:21, DANIEL URBANO DE LA RUA (<
> dannybombas...@gmail.com>) escribió:
>
>> https://docs.djangoproject.com/en/2.2/_modules/django/utils/html/
>> here you have some tricks to do on your view maybe
>>
>> El jue., 14 nov. 2019 a las 21:18, DANIEL URBANO DE LA RUA (<
>> dannybombas...@gmail.com>) escribió:
>>
>>> the main problem is tha you have especial character in a url and the
>>> codification on an url does this to transport the data and your have to fix
>>> it in the request then
>>> at least tray  using  urllib.parse from python check some where an
>>> example
>>>
>>> El jue., 14 nov. 2019 a las 21:15, Patrick Carra ()
>>> escribió:
>>>
 I think my assumption was wrong stackoverflow is down right now so I
 can't go to the link but it seems like somebody is suggesting this is an
 apache/mod_wsgi error
 https://code.djangoproject.com/ticket/14346

 --
 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/120e943c-55f6-4971-b80e-64713b095b7b%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/CAO_yRT0whr2_5NYzNWjBs0g%2BX%3DS2G5YJ2YdO49x-nWwVTF%2BU9w%40mail.gmail.com.


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
https://www.webforefront.com/django/regexpdjangourls.html?
is maybe something related to your url pattern i don't know but something
is wrong because is not working  or did you found a solutions?

El jue., 14 nov. 2019 a las 21:21, DANIEL URBANO DE LA RUA (<
dannybombas...@gmail.com>) escribió:

> https://docs.djangoproject.com/en/2.2/_modules/django/utils/html/
> here you have some tricks to do on your view maybe
>
> El jue., 14 nov. 2019 a las 21:18, DANIEL URBANO DE LA RUA (<
> dannybombas...@gmail.com>) escribió:
>
>> the main problem is tha you have especial character in a url and the
>> codification on an url does this to transport the data and your have to fix
>> it in the request then
>> at least tray  using  urllib.parse from python check some where an
>> example
>>
>> El jue., 14 nov. 2019 a las 21:15, Patrick Carra ()
>> escribió:
>>
>>> I think my assumption was wrong stackoverflow is down right now so I
>>> can't go to the link but it seems like somebody is suggesting this is an
>>> apache/mod_wsgi error
>>> https://code.djangoproject.com/ticket/14346
>>>
>>> --
>>> 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/120e943c-55f6-4971-b80e-64713b095b7b%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/CAO_yRT10%3D4HMYbOSgELAHukc3FdMCDmqfK3df7tYHd9osDK3fg%40mail.gmail.com.


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
https://docs.djangoproject.com/en/2.2/_modules/django/utils/html/
here you have some tricks to do on your view maybe

El jue., 14 nov. 2019 a las 21:18, DANIEL URBANO DE LA RUA (<
dannybombas...@gmail.com>) escribió:

> the main problem is tha you have especial character in a url and the
> codification on an url does this to transport the data and your have to fix
> it in the request then
> at least tray  using  urllib.parse from python check some where an example
>
> El jue., 14 nov. 2019 a las 21:15, Patrick Carra ()
> escribió:
>
>> I think my assumption was wrong stackoverflow is down right now so I
>> can't go to the link but it seems like somebody is suggesting this is an
>> apache/mod_wsgi error
>> https://code.djangoproject.com/ticket/14346
>>
>> --
>> 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/120e943c-55f6-4971-b80e-64713b095b7b%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/CAO_yRT32UdwMet3L74f12PB_QexHk10des%3Dh0%2BRUyh7E0-b8fQ%40mail.gmail.com.


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
the main problem is tha you have especial character in a url and the
codification on an url does this to transport the data and your have to fix
it in the request then
at least tray  using  urllib.parse from python check some where an example

El jue., 14 nov. 2019 a las 21:15, Patrick Carra ()
escribió:

> I think my assumption was wrong stackoverflow is down right now so I can't
> go to the link but it seems like somebody is suggesting this is an
> apache/mod_wsgi error
> https://code.djangoproject.com/ticket/14346
>
> --
> 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/120e943c-55f6-4971-b80e-64713b095b7b%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/CAO_yRT2-9%2BynF_BhrorCUaEy1BSkFyuomZ%2BYe514AKS5f6jpkw%40mail.gmail.com.


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
I think my assumption was wrong stackoverflow is down right now so I can't 
go to the link but it seems like somebody is suggesting this is an 
apache/mod_wsgi error
https://code.djangoproject.com/ticket/14346

-- 
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/120e943c-55f6-4971-b80e-64713b095b7b%40googlegroups.com.


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
No change Daniel I looked that up and I think that is used for something 
else.  The name makes since but its purpose is for something else.

-- 
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/07bf0a2f-43b1-430a-8ded-1272bfa78863%40googlegroups.com.


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
or try to send another unique value it will be easy

El jue., 14 nov. 2019 a las 20:56, DANIEL URBANO DE LA RUA (<
dannybombas...@gmail.com>) escribió:

> or |escape  is the same
>
>
> El jue., 14 nov. 2019 a las 20:55, DANIEL URBANO DE LA RUA (<
> dannybombas...@gmail.com>) escribió:
>
>> {% autoescape on %}
>> {{ post.content }}
>> {% endautoescape %}
>>
>>
>>
>> try this
>>
>> El jue., 14 nov. 2019 a las 20:53, Patrick Carra ()
>> escribió:
>>
>>> There was no change after adding |safe after the value within {{}}
>>> example: >> class="view-item" title="View">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/e023361a-1544-4095-ab6d-53461996947b%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/CAO_yRT3-QERggMihrU4Mj_-t2JWpq-baLQXa8p-DGsA%2BbXBmdw%40mail.gmail.com.


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
or |escape  is the same


El jue., 14 nov. 2019 a las 20:55, DANIEL URBANO DE LA RUA (<
dannybombas...@gmail.com>) escribió:

> {% autoescape on %}
> {{ post.content }}
> {% endautoescape %}
>
>
>
> try this
>
> El jue., 14 nov. 2019 a las 20:53, Patrick Carra ()
> escribió:
>
>> There was no change after adding |safe after the value within {{}}
>> example: > class="view-item" title="View">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/e023361a-1544-4095-ab6d-53461996947b%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/CAO_yRT26rM1QBuy1JLssfZjfRaUwA%2B6s5GynGv%2BG6fa-PDoXqQ%40mail.gmail.com.


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
{% autoescape on %}
{{ post.content }}
{% endautoescape %}



try this

El jue., 14 nov. 2019 a las 20:53, Patrick Carra ()
escribió:

> There was no change after adding |safe after the value within {{}}
> example:  class="view-item" title="View">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/e023361a-1544-4095-ab6d-53461996947b%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/CAO_yRT3qk8Qdf%3DBPbdfjPR92Gaj9E9i1nnOT-kOrpZiPH2OZpw%40mail.gmail.com.


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
There was no change after adding |safe after the value within {{}}
example: 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/e023361a-1544-4095-ab6d-53461996947b%40googlegroups.com.


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
then use |safe template tag from django

El jue., 14 nov. 2019 a las 20:44, Patrick Carra ()
escribió:

> 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.
>>
> --
> 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/55203f72-f8fb-48d9-8ace-09aa652e1721%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/CAO_yRT3UcuSXinaFnJZ-5sBoF5mK2xYtiV_EaV%3Dm7ALPg63_Aw%40mail.gmail.com.


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
That is a value from the table in models called Circuitinfotable and the 
field it is pulled from is called circuitid.

-- 
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/e1e709ad-f9ba-49ab-9f91-0e01c54cc3b9%40googlegroups.com.


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
) escribió:

> then use |safe template tag from django
>
> El jue., 14 nov. 2019 a las 20:44, Patrick Carra ()
> escribió:
>
>> 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.
>>>
>> --
>> 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/55203f72-f8fb-48d9-8ace-09aa652e1721%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/CAO_yRT0BHeRR57qBt-6LdvRkK14QT%2B5qwHEtGSvyG2UX6nj6hg%40mail.gmail.com.


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

-- 
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/55203f72-f8fb-48d9-8ace-09aa652e1721%40googlegroups.com.


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
mrcnew" maxlength="100">
>>>>>>>   
>>>>>>> 
>>>>>>> Search
>>>>>>> 
>>>>>>> 
>>>>>>>   
>>>>>>> 
>>>>>>> {{ filter.qs.count }} circuits returned
>>>>>>> 
>>>>>>>   
>>>>>>> 
>>>>>>>   
>>>>>>> 
>>>>>>>   {% if user.is_authenticated %}
>>>>>>> Edit/
>>>>>>>   {% endif %}
>>>>>>> View
>>>>>>> 
>>>>>>> CircuitID
>>>>>>> Bandwidth
>>>>>>> Region
>>>>>>> Carrier
>>>>>>> Status Segmentname MRC  
>>>>>>>  {% for circuit in filter.qs %}  >>>>>> class="actions"> {% if user.is_authenticated %} >>>>>> title="Edit">Edit {% endif %} >>>>>> title="View">View  {{ circuit.circuitid }} {{
>>>>>>> circuit.bandwidth }} {{ circuit.region }} {{
>>>>>>> circuit.carrier }} {{ circuit.status }} {{
>>>>>>> circuit.segmentname }} {{ circuit.mrcnew }}  {% 
>>>>>>> endfor
>>>>>>> %} {% endblock %} 
>>>>>>>
>>>>>>>
>>>>>>> My project level urls.py file:
>>>>>>> """ciopsdb URL Configuration
>>>>>>>
>>>>>>> The `urlpatterns` list routes URLs to views. For more information
>>>>>>> please see:
>>>>>>> https://docs.djangoproject.com/en/2.2/topics/http/urls/
>>>>>>> Examples:
>>>>>>> Function views
>>>>>>> 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
>>>>>>> 2. Add a URL to urlpatterns:  path('', Home.as_view(),
>>>>>>> name='home')
>>>>>>> Including another URLconf
>>>>>>> 1. Import the include() function: from django.urls import
>>>>>>> include, path
>>>>>>> 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
>>>>>>>
>>>>>>> urlpatterns = [
>>>>>>> path('admin/', admin.site.urls),
>>>>>>> path('', include('homepage.urls')),
>>>>>>> path('searchlit/', include('searchLit.urls')),
>>>>>>> path('viewLit/', include('viewLit.urls')),
>>>>>>> ]
>>>>>>>
>>>>>>>
>>>>>>> My 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='viewLit'),
>>>>>>> ]
>>>>>>>
>>>>>>>
>>>>>>> My viewLit 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
>>>>>>>
>>>>>>> # Create your views here.
>>>>>>> def viewLit(request, circuitid):
>>>>>>> record = Circuitinfotable.objects.get(circuitid=circuitid)
>>>>>>> template = 'viewLit/viewCircuit.html'
>>>>>>> context = {'record':record}
>>>>>>> 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. 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  9. 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_nameException 
>>>>>>> Type: DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: 
>>>>>>> Circuitinfotable matching query does not exist.
>>>>>>>
>>>>>>>
>>>>>>> Any suggestions are appreciated.
>>>>>>>
>>>>>>> --
>>>>>>> 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/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com?utm_medium=email_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>>> 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/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/django-users/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com?utm_medium=email_source=footer>
>>>>>> .
>>>>>>
>>>>>

-- 
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/CAO_yRT36AtOUN3NAC%2BYZ%3DqizTMZAASuZOqQO15asEaDNnQYS_Q%40mail.gmail.com.


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
t;>> 
>>>>>> CircuitID
>>>>>> Bandwidth
>>>>>> Region
>>>>>> Carrier
>>>>>> Status Segmentname MRC  
>>>>>>  {% for circuit in filter.qs %}  >>>>> class="actions"> {% if user.is_authenticated %} >>>>> title="Edit">Edit {% endif %} >>>>> title="View">View  {{ circuit.circuitid }} {{
>>>>>> circuit.bandwidth }} {{ circuit.region }} {{
>>>>>> circuit.carrier }} {{ circuit.status }} {{
>>>>>> circuit.segmentname }} {{ circuit.mrcnew }}  {% endfor
>>>>>> %} {% endblock %} 
>>>>>>
>>>>>>
>>>>>> My project level urls.py file:
>>>>>> """ciopsdb URL Configuration
>>>>>>
>>>>>> The `urlpatterns` list routes URLs to views. For more information
>>>>>> please see:
>>>>>> https://docs.djangoproject.com/en/2.2/topics/http/urls/
>>>>>> Examples:
>>>>>> Function views
>>>>>> 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
>>>>>> 2. Add a URL to urlpatterns:  path('', Home.as_view(),
>>>>>> name='home')
>>>>>> Including another URLconf
>>>>>> 1. Import the include() function: from django.urls import
>>>>>> include, path
>>>>>> 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
>>>>>>
>>>>>> urlpatterns = [
>>>>>> path('admin/', admin.site.urls),
>>>>>> path('', include('homepage.urls')),
>>>>>> path('searchlit/', include('searchLit.urls')),
>>>>>> path('viewLit/', include('viewLit.urls')),
>>>>>> ]
>>>>>>
>>>>>>
>>>>>> My 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='viewLit'),
>>>>>> ]
>>>>>>
>>>>>>
>>>>>> My viewLit 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
>>>>>>
>>>>>> # Create your views here.
>>>>>> def viewLit(request, circuitid):
>>>>>> record = Circuitinfotable.objects.get(circuitid=circuitid)
>>>>>> template = 'viewLit/viewCircuit.html'
>>>>>> context = {'record':record}
>>>>>> 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. 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  9. 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_nameException 
>>>>>> Type: DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: 
>>>>>> Circuitinfotable matching query does not exist.
>>>>>>
>>>>>>
>>>>>> Any suggestions are appreciated.
>>>>>>
>>>>>> --
>>>>>> 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/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com?utm_medium=email_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>>> 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/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>>

-- 
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/CAO_yRT33QibaVifcukK%2BHhDJ3VBbzPaE%3DgJiMVGFaGM4YxcC7A%40mail.gmail.com.


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
;>> circuit.segmentname }} {{ circuit.mrcnew }}  {% endfor
>>>>> %} {% endblock %} 
>>>>>
>>>>>
>>>>> My project level urls.py file:
>>>>> """ciopsdb URL Configuration
>>>>>
>>>>> The `urlpatterns` list routes URLs to views. For more information
>>>>> please see:
>>>>> https://docs.djangoproject.com/en/2.2/topics/http/urls/
>>>>> Examples:
>>>>> Function views
>>>>> 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
>>>>> 2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
>>>>> Including another URLconf
>>>>> 1. Import the include() function: from django.urls import include,
>>>>> path
>>>>> 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
>>>>>
>>>>> urlpatterns = [
>>>>> path('admin/', admin.site.urls),
>>>>> path('', include('homepage.urls')),
>>>>> path('searchlit/', include('searchLit.urls')),
>>>>> path('viewLit/', include('viewLit.urls')),
>>>>> ]
>>>>>
>>>>>
>>>>> My 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='viewLit'),
>>>>> ]
>>>>>
>>>>>
>>>>> My viewLit 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
>>>>>
>>>>> # Create your views here.
>>>>> def viewLit(request, circuitid):
>>>>> record = Circuitinfotable.objects.get(circuitid=circuitid)
>>>>> template = 'viewLit/viewCircuit.html'
>>>>> context = {'record':record}
>>>>> 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. 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  9. 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_nameException Type: 
>>>>> DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: 
>>>>> Circuitinfotable matching query does not exist.
>>>>>
>>>>>
>>>>> Any suggestions are appreciated.
>>>>>
>>>>> --
>>>>> 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/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> 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/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>>

-- 
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/CAO_yRT2SfDJX2DDdJxRjaDZmuYY_3SubZbw4R-WsUxtHKrYw8w%40mail.gmail.com.


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
t; 1. Add an import:  from other_app.views import Home
>>>> 2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
>>>> Including another URLconf
>>>> 1. Import the include() function: from django.urls import include,
>>>> path
>>>> 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
>>>>
>>>> urlpatterns = [
>>>> path('admin/', admin.site.urls),
>>>> path('', include('homepage.urls')),
>>>> path('searchlit/', include('searchLit.urls')),
>>>> path('viewLit/', include('viewLit.urls')),
>>>> ]
>>>>
>>>>
>>>> My 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='viewLit'),
>>>> ]
>>>>
>>>>
>>>> My viewLit 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
>>>>
>>>> # Create your views here.
>>>> def viewLit(request, circuitid):
>>>> record = Circuitinfotable.objects.get(circuitid=circuitid)
>>>> template = 'viewLit/viewCircuit.html'
>>>> context = {'record':record}
>>>> 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. 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  9. 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_nameException Type: 
>>>> DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: Circuitinfotable 
>>>> matching query does not exist.
>>>>
>>>>
>>>> Any suggestions are appreciated.
>>>>
>>>> --
>>>> 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/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>>> 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/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>

-- 
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/CAO_yRT2hy0ejy_UkeMXfmECGggGJ4BfZ_OxOmRPpAimGtWzf5Q%40mail.gmail.com.


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
Could you provide an example of what you mean?  I'm not sure what you mean 
by method call must include an object instance as argument.  This code 
works for other values of circuitid but does not work for one that contains 
a //.  This tells me, along with the traceback code, that django at some 
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 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/62a01aa1-3686-4451-adcb-48a78f6e98d1%40googlegroups.com.


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
gt;>> please see:
>>>> https://docs.djangoproject.com/en/2.2/topics/http/urls/
>>>> Examples:
>>>> Function views
>>>> 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
>>>> 2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
>>>> Including another URLconf
>>>> 1. Import the include() function: from django.urls import include, 
>>>> path
>>>> 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
>>>>
>>>> urlpatterns = [
>>>> path('admin/', admin.site.urls),
>>>> path('', include('homepage.urls')),
>>>> path('searchlit/', include('searchLit.urls')),
>>>> path('viewLit/', include('viewLit.urls')),
>>>> ]
>>>>
>>>>
>>>> My 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='viewLit'),
>>>> ]
>>>>
>>>>
>>>> My viewLit 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
>>>>
>>>> # Create your views here.
>>>> def viewLit(request, circuitid):
>>>> record = Circuitinfotable.objects.get(circuitid=circuitid)
>>>> template = 'viewLit/viewCircuit.html'
>>>> context = {'record':record}
>>>> 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. 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  9. 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_nameException Type: 
>>>> DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: Circuitinfotable 
>>>> matching query does not exist.
>>>>
>>>>
>>>> Any suggestions are appreciated.  
>>>>
>>>> -- 
>>>> 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...@googlegroups.com .
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>

-- 
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/9c405720-183f-4467-bcde-4ef4a7367d04%40googlegroups.com.


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.conf.urls import url
>>>
>>> urlpatterns = [
>>> path('admin/', admin.site.urls),
>>> path('', include('homepage.urls')),
>>> path('searchlit/', include('searchLit.urls')),
>>> path('viewLit/', include('viewLit.urls')),
>>> ]
>>>
>>>
>>> My 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='viewLit'),
>>> ]
>>>
>>>
>>> My viewLit 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
>>>
>>> # Create your views here.
>>> def viewLit(request, circuitid):
>>> record = Circuitinfotable.objects.get(circuitid=circuitid)
>>> template = 'viewLit/viewCircuit.html'
>>> context = {'record':record}
>>> 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. 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  9. 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_nameException Type: 
>>> DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: Circuitinfotable 
>>> matching query does not exist.
>>>
>>>
>>> Any suggestions are appreciated.
>>>
>>> --
>>> 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/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAO_yRT0N74sYAcDhcZGKT56%3D387-kx8QcnViKvyvJ23tfcWROA%40mail.gmail.com.


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
e
>> from django.views.generic import TemplateView
>>
>> from . models import Circuitinfotable, Budgettable, Xcinventorytable
>>
>> # Create your views here.
>> def viewLit(request, circuitid):
>> record = Circuitinfotable.objects.get(circuitid=circuitid)
>> template = 'viewLit/viewCircuit.html'
>> context = {'record':record}
>> 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. 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  9. 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_nameException Type: 
>> DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: Circuitinfotable 
>> matching query does not exist.
>>
>>
>> Any suggestions are appreciated.
>>
>> --
>> 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/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAO_yRT33eVfpa4eSacGdQKD7cZr_rEO%3DLBiWuaMQauaWSXpw2w%40mail.gmail.com.


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
rs/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  9. 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_nameException Type: 
> DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: Circuitinfotable 
> matching query does not exist.
>
>
> Any suggestions are appreciated.
>
> --
> 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/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAP5HUWqOnTrZvzArw77fnyDRHP4BA9QmoUEdR4a9boMFVxggRg%40mail.gmail.com.


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

2019-11-14 Thread Patrick Carra
I am passing a parameter in a url to another view and during the process it 
gets changed.  An original parameter example that produces the error 
is OQYX/173774//ZYO but gets changed to '/viewLit/OQYX/173774/ZYO/' It 
drops the second / between 173774 and ZYO. I assumed this was because it 
was treating it as an escape character? So I tried adding an r in the 
urls.py file but it did not have any effect. Here is my template code for 
the page that generates the hyperlink:




Circuits

h1 {
color:blue;
}
h4 {
color:red;
}
.tabledata {
  background: #395870; color:#fff;
}
.tablerow:nth-child(even) {
  background-color: #f2f2f2;
}
.form{
  width:100%;
}
.field {
  background: #white; float: left; margin: 1%; width: 200;
}

{% block content %}
  Search Lit Circuits
Enter your search criteria below:


  
Circuit ID:
Bandwidth:
Region:
  
  
Carrier:
Status:
Segmentname:
  
  
MRC:
  

Search


  

{{ filter.qs.count }} circuits returned

  

  

  {% if user.is_authenticated %}
Edit/
  {% endif %}
View

CircuitID
Bandwidth
Region
Carrier
Status Segmentname MRC{% 
for circuit in filter.qs %}   {% 
if user.is_authenticated %} Edit {% endif %} View  {{ circuit.circuitid }} {{ 
circuit.bandwidth }} {{ circuit.region }} {{ 
circuit.carrier }} {{ circuit.status }} {{ 
circuit.segmentname }} {{ circuit.mrcnew }}  {% endfor 
%} {% endblock %}  


My project level urls.py file:
"""ciopsdb URL Configuration

The `urlpatterns` list routes URLs to views. For more information please 
see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
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
2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
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

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('homepage.urls')),
path('searchlit/', include('searchLit.urls')),
path('viewLit/', include('viewLit.urls')),
]


My 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='viewLit'),
]


My viewLit 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

# Create your views here.
def viewLit(request, circuitid):
record = Circuitinfotable.objects.get(circuitid=circuitid)
template = 'viewLit/viewCircuit.html'
context = {'record':record}
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. 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  9. 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_nameException Type: 
DoesNotExist at /viewLit/OQYX/173774/ZYO/Exception Value: Circuitinfotable 
matching query does not exist.


Any suggestions are appreciated.  

-- 
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/49da6357-27be-42fa-8b88-fc9c223654d8%40googlegroups.com.


Re: User matching query does not exist.

2019-09-07 Thread Gabriel Stone
Tamam all the best

On Sat, Sep 7, 2019 at 23:12 göktürk sığırtmaç 
wrote:

> I solved it!!! using ObjectDoesNotExist via javatpoint. (
> https://www.javatpoint.com/django-exceptions)
>
> try:
> user = User.objects.get(email=email)
> except ObjectDoesNotExist:
> user = None;
>
>
> 7 Eylül 2019 Cumartesi 23:36:00 UTC+3 tarihinde göktürk sığırtmaç yazdı:
>>
>> 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 to convert
>> message. I have tried this
>>
>> try:
>> user = User.objects.get(email=email)
>> except:
>> user = None;
>>
>>
>> if user is None:
>> messages.warning(request, "Email hatalı")
>> print("email is wrong")
>> return render(request, "login.html", context)
>>
>>
>>  code but my each login attempt, i have message "e mail is wrong"
>>
>>
>> --
> 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/0b36cb1f-d42c-4783-86a7-fcfaf0cbfb99%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/0b36cb1f-d42c-4783-86a7-fcfaf0cbfb99%40googlegroups.com?utm_medium=email_source=footer>
> .
>
-- 
Gabrielstone

-- 
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/CAL-5MpV8y_rfdDxDR7KsgCeD%3Dys3aQALvi_yOGeWOyYqtBrw_Q%40mail.gmail.com.


Re: User matching query does not exist.

2019-09-07 Thread göktürk sığırtmaç
I solved it!!! using ObjectDoesNotExist via javatpoint. (
https://www.javatpoint.com/django-exceptions) 

try:
user = User.objects.get(email=email)
except ObjectDoesNotExist:
user = None;


7 Eylül 2019 Cumartesi 23:36:00 UTC+3 tarihinde göktürk sığırtmaç yazdı:
>
> 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 to convert 
> message. I have tried this
>
> try:
> user = User.objects.get(email=email)
> except:
> user = None;
>
>
> if user is None:
> messages.warning(request, "Email hatalı")
> print("email is wrong")
> return render(request, "login.html", context)
>
>
>  code but my each login attempt, i have message "e mail is wrong"
>
>
>

-- 
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/0b36cb1f-d42c-4783-86a7-fcfaf0cbfb99%40googlegroups.com.


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, 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 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 to convert 
>> message. I have tried this
>>
>> try:
>> user = User.objects.get(email=email)
>> except:
>> user = None;
>>
>>
>> if user is None:
>> messages.warning(request, "Email hatalı")
>> print("email is wrong")
>> return render(request, "login.html", context)
>>
>>
>>  code but my each login attempt, i have message "e mail is wrong"
>>
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/985ce3b9-2810-48ef-9840-e18515109f4b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/985ce3b9-2810-48ef-9840-e18515109f4b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> -- 
> Gabrielstone
>

-- 
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/449722c8-b307-4001-aac6-cf4102e30bb4%40googlegroups.com.


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 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 to convert
> message. I have tried this
>
> try:
> user = User.objects.get(email=email)
> except:
> user = None;
>
>
> if user is None:
> messages.warning(request, "Email hatalı")
> print("email is wrong")
> return render(request, "login.html", context)
>
>
>  code but my each login attempt, i have message "e mail is wrong"
>
>
> --
> 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/985ce3b9-2810-48ef-9840-e18515109f4b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/985ce3b9-2810-48ef-9840-e18515109f4b%40googlegroups.com?utm_medium=email_source=footer>
> .
>
-- 
Gabrielstone

-- 
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/CAL-5MpWb6fpUZs%3Dvrztc%3DjN8RaUNYax1nwGXegR1J-cG0Mk2dA%40mail.gmail.com.


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 to convert 
message. I have tried this

try:
user = User.objects.get(email=email)
except:
user = None;


if user is None:
messages.warning(request, "Email hatalı")
print("email is wrong")
return render(request, "login.html", context)


 code but my each login attempt, i have message "e mail is wrong"


-- 
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/985ce3b9-2810-48ef-9840-e18515109f4b%40googlegroups.com.


Re: Matching query does not exist

2019-01-18 Thread Kasper Laudrup

Hi again Ivan,

On 1/18/19 11:22 AM, Ivan Martić wrote:

im not sure that i understand "specifying your database columns explicitly".
I have connected to existing MSSQL database so i had to adapt my model 
due to that.


That's exactly what I mean :-)

I don't have any experience with using existing database models with 
Django (I just let Django take care of handling database entries).


Hopefully someone else can help you.

Best of luck.

Kasper Laudrup

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8186a71d-5d63-4923-b0b1-039ff3254a2c%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: Matching query does not exist

2019-01-18 Thread Ivan Martić
Hi,

im not sure that i understand "specifying your database columns explicitly".
I have connected to existing MSSQL database so i had to adapt my model due
to that. Just copied model from inspectdb and added:
- def __str__
-ForeignKey(class name, on delete=models.CASCADE)xtimes for materialid
and group.

I am not so experience  as you :) but i think you are on the good lead.
I am watching this case :
https://stackoverflow.com/questions/44107021/django-admin-doesnt-display-value
Seems like same issue, same error occured.
What do you think?

pet, 18. sij 2019. u 11:16 Kasper Laudrup  napisao
je:

> Hi Ivan,
>
> On 1/18/19 10:59 AM, Ivan Martić wrote:
> > Thank you Kasper,
> >
>
> You're welcome.
>
> > i have copied that model after doing inspectdb. So it should be set by
> > default from django that way. Usually all was ok..
> > Also, i have tried that  change now and got the same result.
> >
> > Any other idea where i gone wrong?
> >
>
> Sorry, not really. I'm wondering why you are specifying your database
> columns explicitly though? I've never had a need for that, but I'm far
> from being very experienced with Django.
>
> Hopefully someone else can help you.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/54b11d43-d6c5-dcff-6d3d-29cbeca2ef43%40stacktrace.dk
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C-2tbFNeo_JJV7tt8LYPP%3DP%3DKJXbEXjfQuLFEQgMP86-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Matching query does not exist

2019-01-18 Thread Kasper Laudrup

Hi Ivan,

On 1/18/19 10:59 AM, Ivan Martić wrote:

Thank you Kasper,



You're welcome.

i have copied that model after doing inspectdb. So it should be set by 
default from django that way. Usually all was ok..

Also, i have tried that  change now and got the same result.

Any other idea where i gone wrong?



Sorry, not really. I'm wondering why you are specifying your database 
columns explicitly though? I've never had a need for that, but I'm far 
from being very experienced with Django.


Hopefully someone else can help you.

Kind regards,

Kasper Laudrup

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54b11d43-d6c5-dcff-6d3d-29cbeca2ef43%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: Matching query does not exist

2019-01-18 Thread Ivan Martić
Thank you Kasper, 

i have copied that model after doing inspectdb. So it should be set by 
default from django that way. Usually all was ok..
Also, i have tried that  change now and got the same result.

Any other idea where i gone wrong?

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/836e1018-233d-4eb4-9f24-39dd321ce253%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Matching query does not exist

2019-01-18 Thread Aditya Singh


On Jan 18, 2019 3:19 PM, "Kasper Laudrup"  wrote:

Hi Ivan,


On 1/18/19 10:25 AM, Ivan Martić wrote:
> Hi all,
>   i am having trouble to get this query on db table right.
> I am always getting error.
>

In your definition of the Material model, the materialid field is
defined like this:

materialid = models.CharField(db_column='MaterialID', max_length=10)

Whereas you refer to it in Productgroupinput like this:

materialid = models.ForeignKey(Material, on_delete=models.CASCADE,
db_column='Materialid', max_length=10)

Notice the difference in the db_column parameter?

I guess that could be the cause of your error.

Kind regards,

Kasper Laudrup



-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/8daaaf0f-17c3-69c5-8b86-915df7ba348e%40stacktrace.dk
.

For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPfumjfe6bdiiOa%2BVg-TixRoFNgd1CEiyVwMCET-McDD7FTCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Matching query does not exist

2019-01-18 Thread Kasper Laudrup

Hi Ivan,

On 1/18/19 10:25 AM, Ivan Martić wrote:

Hi all,
  i am having trouble to get this query on db table right.
I am always getting error.



In your definition of the Material model, the materialid field is 
defined like this:


materialid = models.CharField(db_column='MaterialID', max_length=10)

Whereas you refer to it in Productgroupinput like this:

materialid = models.ForeignKey(Material, on_delete=models.CASCADE, 
db_column='Materialid', max_length=10)


Notice the difference in the db_column parameter?

I guess that could be the cause of your error.

Kind regards,

Kasper Laudrup


--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8daaaf0f-17c3-69c5-8b86-915df7ba348e%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Matching query does not exist

2019-01-18 Thread Ivan Martić
Hi all,
 i am having trouble to get this query on db table right. 
I am always getting error.

Please check shell erorr attached.

I appreciate your help!




-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ca5a10a1-b8ea-4950-89b7-6806a4682ef8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#models

from __future__ import unicode_literals
from django.db import models, connection
from django.utils import timezone
from datetime import date



class Material(models.Model):
id = models.IntegerField(db_column='ID', primary_key=True, blank=False, 
unique=True)
bukrs = models.CharField(db_column='Bukrs', max_length=4)
materialid = models.CharField(db_column='MaterialID', max_length=10)
material_name = models.CharField(db_column='Material_name', max_length=7)

class Meta:
managed = False
db_table = 'Material'

def __str__(self):
return '%s %s %s' % (self.bukrs, self.materialid, self.material_name)


class MaterialGroup(models.Model):
id = models.CharField(db_column='ID', max_length=255, blank=False, 
primary_key=True)
material_group = models.CharField(db_column='Material Group', 
max_length=255, blank=True, null=True)

class Meta:
managed = False
db_table = 'Material Group'

def __str__(self):
return '%s' % (self.material_group)


class Productgroupinput(models.Model):
id = models.IntegerField(db_column='ID', primary_key=True, blank=False, 
unique=True)
bukrs = models.CharField(db_column='Bukrs', max_length=4)
materialid = models.ForeignKey(Material, on_delete=models.CASCADE, 
db_column='Materialid', max_length=10)
material_group = models.ForeignKey(MaterialGroup, on_delete=models.CASCADE, 
db_column='Material_group', max_length=2)

class Meta:
managed = False
db_table = 'ProductGroupInput'

def __str__(self):
return '%s %s %s' % (self.bukrs, self.materialid, self.material_group)>>> from productsgrouping.models import Material, MaterialGroup, 
>>> Productgroupinput
>>> test = Productgroupinput.objects.all()
>>> test
Traceback (most recent call last):
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\fields\related_des
criptors.py", line 163, in __get__
rel_obj = self.field.get_cached_value(instance)
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\fields\mixins.py",
 line 13, in get_cached_value
return instance._state.fields_cache[cache_name]
KeyError: 'materialid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\query.py",
 line 24
7, in __repr__
return '<%s %r>' % (self.__class__.__name__, data)
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\base.py",
 line 503
, in __repr__
return '<%s: %s>' % (self.__class__.__name__, self)
  File "C:\Users\martici\QIF\qif\productsgrouping\models.py", line 45, in 
__str__
return '%s %s %s' % (self.bukrs, self.materialid, self.material_group)
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\fields\related_des
criptors.py", line 177, in __get__
rel_obj = self.get_object(instance)
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\fields\related_des
criptors.py", line 144, in get_object
return qs.get(self.field.get_reverse_related_filter(instance))
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\query.py",
 line 39
9, in get
self.model._meta.object_name
productsgrouping.models.Material.DoesNotExist: Material matching query does not 
exist.>>> query = Material.objects.all()
>>> query
, , , , ]>
>>>

Re: note matching query does not exist.

2018-09-13 Thread Yash Thakkar
I’m agree with you that you should use filter(). Or you can use
objectname.DoesNotExist as an exception.

On Thu, Sep 13, 2018 at 7:07 AM Manuel Alejandro Garrido Gongora <
nolodelato...@gmail.com> wrote:

> It is likely because you are getting a directly on an object that probably
> does not exist in the database, I recommend that you use it instead of get
> filter (). first () or the method get_object_or_404 from django Regards
>
> Enviado desde mi iPhone
>
> El 12 sept 2018, a las 19:43, Gear Crew 
> escribió:
>
> what's the problem I sure no any error in code
>
> 
>
> 
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0de12f97-7541-4aba-a280-adae62dd7c5a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> 
>
> 
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/E1370835-D55F-40B0-864B-D09CDE5A6CE3%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFBVQh_jSZGAFCV4UuEAj5M0wQ5kSQA_78r0VzvK67P6PSvt%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: note matching query does not exist.

2018-09-13 Thread Manuel Alejandro Garrido Gongora
It is likely because you are getting a directly on an object that probably does 
not exist in the database, I recommend that you use it instead of get filter 
(). first () or the method get_object_or_404 from django Regards

Enviado desde mi iPhone

> El 12 sept 2018, a las 19:43, Gear Crew  
> escribió:
> 
> what's the problem I sure no any error in code
> 
> 
> 
> 
> 
> 
> -- 
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/0de12f97-7541-4aba-a280-adae62dd7c5a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E1370835-D55F-40B0-864B-D09CDE5A6CE3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Matching query does not exist after a post_data signal, but in fact does exist when visiting the url sent by the query

2017-05-17 Thread Constantine Covtushenko
Hi, François-Xavier

I believe that the reason of that is a transaction that is not committed
yet  when your code reaches 'post_save' listener.
And when you use 'requests' library there is nothing in the DB yet.

And I am just curios why there is a need of saving 'admin view' in the DB?

Regards,
Constantine C.

On Tue, May 16, 2017 at 10:17 PM, François-Xavier Cao <nam.fx@gmail.com>
wrote:

> Hi everone,
>
>
> I started to code a two-apps django project. ModelA belongs to appone and
> ModelB belongs to apptwo. My purpose is to create a ModelA instance
> everytime that the user creates a ModelB instance. And the value of a
> ModelA CharField (that is ckeditor widgeted) must be the source code of a
> ModelB admin view. I used a post_data signal to link a function of creation
> for that. The problem is that i use the id of each instance of ModelB in
> order to create the good content for each instance of ModelA. When I try to
> use a string of the url sending the id parameter, the content field has for
> value the source code of the debug page
>
> (error 500, DoesNotExist at /admin/apptwo/modelb/my_view/ref=76, [76 is
> an example] ModelB matching query does not exist. Exception location :
> /home/me/Desktop/env/lib/python3.5/site-packages/django/db/models/query.py
> in get, line 385)
>
> But when I try to visit the url "http://localhost:8000//admin/
> apptwo/modelb/my_view/ref=76", or when I hardcode the url, without a str(
> instance.id), the page exists and everything works perfectly.
>
> I don't understand why.
>
> Could anybody give me some help to solve this problem ?
>
> Thanks in advance,
>
> --
>
> PS :
>
> The first app has a model.py that contains the following code :
>
>
> from django.db import models
> from django.contrib.auth.models import Userfrom registre.models import *
> class ModelA(models.Model):
> content = models.CharField(max_length=255, null=True)
> def __str__(self):
> return "ModelA : " + str(self.id)
>
>
>
>
> the admin.py of this first app also contains :
>
>
> from django.contrib import admin
> from appone.models import *
> from apptwo.models import ModelB
> from django.http import HttpResponse
> from django.template.response import TemplateResponse
> from django.conf.urls import url
> from registre import views
> from django.db.models.signals import post_save
> from django.dispatch import receiver
> import datetime
> from django.contrib.auth.models import User
> from django import forms
> from ckeditor.widgets import CKEditorWidget
> from django.template.loader import render_to_string
> import requests
>
> class ModelAAdminForm(forms.ModelForm):
> content = forms.CharField(widget=CKEditorWidget())
> class Meta:
> model = ModelA
> fields = '__all__'
>
> class ModelAAdmin(admin.ModelAdmin):
> form = ModelAAdminForm
>
> def create_A(sender, instance, **kwargs):
> string = "http://localhost:8000/admin/apptwo/modelb/my_view/ref=; + 
> str(instance.id)
> r = requests.get(string)
> ModelA.objects.create(contenu=r.text.encode('utf-8'))
>
> post_save.connect(create_A, sender=ModelB)
>
> admin.site.register(ModelA, ModelAAdmin)
>
>
>
>
>
> the second app (apptwo) has a models.py like this :
>
>
>
> from django.db import models
> from django.contrib.auth.models import User
>
> class ModelB(models.Model):
> owner = models.ForeignKey(User, null=True)
> name = models.CharField(max_length=255, null=True)
>
> def __str__(self):
> return self.name
>
>
>
>
> and an admin.py that contains :
>
>
>
> from django.contrib import admin
> from appone.models import *
> from apptwo.models import *
> import datetime
> from django.conf.urls import url, include
> from django.template.response import TemplateResponse
>
> class ModelBAdmin(admin.ModelAdmin):
>
> def get_queryset(self, request):
> qs = super(ModelB, self).get_queryset(request)
> if request.user.is_superuser:
> return qs
> return qs.filter(owner=request.user)
>
> def save_model(self, request, obj, form, change):
> obj.owner = request.user
> obj.save()
>
> def get_urls(self):
> urls = super(ModelBAdmin, self).get_urls()
> my_urls = [
> url(r'^my_view/ref=(?P\d+)$', self.my_view),
> ]
> return my_urls + urls
>
> def my_view(self, request, id):
> context = dict(
>self.admin_site.each_

Matching query does not exist after a post_data signal, but in fact does exist when visiting the url sent by the query

2017-05-16 Thread François-Xavier Cao
 

Hi everone, 


I started to code a two-apps django project. ModelA belongs to appone and 
ModelB belongs to apptwo. My purpose is to create a ModelA instance 
everytime that the user creates a ModelB instance. And the value of a 
ModelA CharField (that is ckeditor widgeted) must be the source code of a 
ModelB admin view. I used a post_data signal to link a function of creation 
for that. The problem is that i use the id of each instance of ModelB in 
order to create the good content for each instance of ModelA. When I try to 
use a string of the url sending the id parameter, the content field has for 
value the source code of the debug page 

(error 500, DoesNotExist at /admin/apptwo/modelb/my_view/ref=76, [76 is an 
example] ModelB matching query does not exist. Exception location : 
/home/me/Desktop/env/lib/python3.5/site-packages/django/db/models/query.py 
in get, line 385)

But when I try to visit the url "
http://localhost:8000//admin/apptwo/modelb/my_view/ref=76;, or when I 
hardcode the url, without a str(instance.id), the page exists and 
everything works perfectly.

I don't understand why. 

Could anybody give me some help to solve this problem ?

Thanks in advance,

--

PS : 

The first app has a model.py that contains the following code : 


from django.db import models
from django.contrib.auth.models import Userfrom registre.models import *
class ModelA(models.Model):
content = models.CharField(max_length=255, null=True)
def __str__(self):
return "ModelA : " + str(self.id)




the admin.py of this first app also contains : 


from django.contrib import admin
from appone.models import *
from apptwo.models import ModelB
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.conf.urls import url
from registre import views
from django.db.models.signals import post_save
from django.dispatch import receiver
import datetime
from django.contrib.auth.models import User
from django import forms
from ckeditor.widgets import CKEditorWidget
from django.template.loader import render_to_string
import requests

class ModelAAdminForm(forms.ModelForm):
content = forms.CharField(widget=CKEditorWidget())
class Meta:
model = ModelA
fields = '__all__'

class ModelAAdmin(admin.ModelAdmin):
form = ModelAAdminForm

def create_A(sender, instance, **kwargs):
string = "http://localhost:8000/admin/apptwo/modelb/my_view/ref=; + 
str(instance.id)
r = requests.get(string)
ModelA.objects.create(contenu=r.text.encode('utf-8'))

post_save.connect(create_A, sender=ModelB) 

admin.site.register(ModelA, ModelAAdmin)





the second app (apptwo) has a models.py like this : 



from django.db import models
from django.contrib.auth.models import User

class ModelB(models.Model):
owner = models.ForeignKey(User, null=True)
name = models.CharField(max_length=255, null=True)

def __str__(self):
return self.name




and an admin.py that contains : 



from django.contrib import admin
from appone.models import *
from apptwo.models import *
import datetime
from django.conf.urls import url, include
from django.template.response import TemplateResponse

class ModelBAdmin(admin.ModelAdmin):

def get_queryset(self, request):
qs = super(ModelB, self).get_queryset(request)
if request.user.is_superuser:
return qs
return qs.filter(owner=request.user)

def save_model(self, request, obj, form, change):
obj.owner = request.user
obj.save()

def get_urls(self):
urls = super(ModelBAdmin, self).get_urls()
my_urls = [
url(r'^my_view/ref=(?P\d+)$', self.my_view),
]
return my_urls + urls

def my_view(self, request, id):
context = dict(
   self.admin_site.each_context(request),
   selector = ModelB.objects.get(id=id),
)
return TemplateResponse(request, "myview.html", context)

admin.site.register(ModelB, ModelBAdmin)







and finally a template myview.html with : 


Test {{ selector.name }}

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c146a55b-12ed-47d8-8bcb-7b5fc405b739%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting error "Project matching query does not exist."

2017-04-15 Thread Camilo Torres
Hi,
I agree with Ludovic in "your application may be badly installed". But it 
is very hard to tell what is going wrong without actually knowing what your 
app should show (what view function) for URL path /brickly/home
I cannot tell you what view is that without knowing about your code nor 
your business rules for that page.
You have to ask the original developers what view should show there, and 
try to writhe the url conf for that.

On Wednesday, April 12, 2017 at 7:02:09 AM UTC-4, ludovic coues wrote:
>
> I would search the function doing the redirection and look at what 
> information it use to make that redirection.
>
> Either it is redirecting to a wrong url or something have gone wrong when 
> installing the brickly application.
>
> 2017-04-12 12:46 GMT+02:00 <ni...@linkites.com >:
>
>> Hi,
>>
>> I have solved validationError on django and now project redirecting on 
>> url "http://127.0.0.1:8000/brickly/home; and its not found. so please 
>> let me know how to create it on django.
>>
>> here are page not found error coming. please let me know of what is the 
>> problem.
>>
>>
>> Page not found (404) 
>> Request Method: GET 
>> Request URL: http://127.0.0.1:8000/brickly/home
>>
>>
>> On Tuesday, April 11, 2017 at 4:38:30 PM UTC+5:30, ni...@linkites.com 
>> wrote:
>>>
>>> Hi,
>>>
>>> I have setup existing django project at localsystem and its migrate 
>>> successfully.
>>> after migrate i have run following "python manage.py runserver" to run 
>>> django project.
>>>
>>> After that i am getting error message "Project matching query does not 
>>> exist." on terminal and as well as browser.
>>>
>>> Please let me know of what is problem.
>>>
>>>
>>>
>>> Please help me to solve this issue.
>>>
>>> Thanks,
>>>
>>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/7f1af12d-50ba-48fb-8774-4c4f6c47be58%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/7f1af12d-50ba-48fb-8774-4c4f6c47be58%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Cordialement, Ludovic Coues 
> +33 6 14 87 43 42
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9844ce13-61d3-46e8-8a91-5d0deb74f3c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting error "Project matching query does not exist."

2017-04-12 Thread ludovic coues
I would search the function doing the redirection and look at what
information it use to make that redirection.

Either it is redirecting to a wrong url or something have gone wrong when
installing the brickly application.

2017-04-12 12:46 GMT+02:00 <ni...@linkites.com>:

> Hi,
>
> I have solved validationError on django and now project redirecting on url
> "http://127.0.0.1:8000/brickly/home; and its not found. so please let me
> know how to create it on django.
>
> here are page not found error coming. please let me know of what is the
> problem.
>
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/brickly/home
>
>
> On Tuesday, April 11, 2017 at 4:38:30 PM UTC+5:30, ni...@linkites.com
> wrote:
>>
>> Hi,
>>
>> I have setup existing django project at localsystem and its migrate
>> successfully.
>> after migrate i have run following "python manage.py runserver" to run
>> django project.
>>
>> After that i am getting error message "Project matching query does not
>> exist." on terminal and as well as browser.
>>
>> Please let me know of what is problem.
>>
>>
>>
>> Please help me to solve this issue.
>>
>> Thanks,
>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/7f1af12d-50ba-48fb-8774-4c4f6c47be58%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7f1af12d-50ba-48fb-8774-4c4f6c47be58%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Cordialement, Ludovic Coues
+33 6 14 87 43 42

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTZT3M8FMXb%2BmNiNgxvFSRKX3bmteDO1FmOvecL9BefHLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   >