hanged = 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
o
>> share hosting. How can I resolve it?
>>
>> Please advise.
>>
>> DoesNotExist at /
>>
>> Currency matching query does not exist.
>>
>> Request Method: GET
>> Request URL: http://fullcart.co.ke/
>> Django Version: 3.0.7
>>
share hosting. How can I resolve it?
>>
>> Please advise.
>>
>> DoesNotExist at /
>>
>> Currency matching query does not exist.
>>
>> Request Method: GET
>> Request URL: http://fullcart.co.ke/
>> Django Version: 3.0.7
>> Exception Type: D
Is your hosting support python
On Mon, Dec 28, 2020, 12:49 PM tech george wrote:
> Hello,
>
> I am getting the error as shown below when uploading my django project to
> share hosting. How can I resolve it?
>
> Please advise.
>
> DoesNotExist at /
>
> Currency
.@gmail.com
wrote:
> Hello,
>
> I am getting the error as shown below when uploading my django project to
> share hosting. How can I resolve it?
>
> Please advise.
>
> DoesNotExist at /
>
> Currency matching query does not exist.
>
> Request Method: GET
> Re
Hello,
I am getting the error as shown below when uploading my django project to
share hosting. How can I resolve it?
Please advise.
DoesNotExist at /
Currency matching query does not exist.
Request Method: GET
Request URL: http://fullcart.co.ke/
Django Version: 3.0.7
Exception Type
for people checking this in 2018 you need to check the settings
INSTALLED_APPS = [
>
>
> 'django.contrib.sites', this needs to go or you need to Increment
> SITE_ID if you really need the app to be installed
>
--
You received this message because you are subscribed to the Google Groups
"
On Oct 23, 2017 4:06 PM, "'Aaron C. de Bruyn' via Django users" <
django-users@googlegroups.com> wrote:
The difference between .filter() and .get() is definitely 'by-design'.
When you filter through a list of objects, you could end up with zero,
one, or many objects returned.
When you call .get(
you propose, the exception gets thrown by db.models query.py and is
declared as a simple
raise DoesNotExist...
And this then bubbles all the way back through the middleware.
The simplest answer for my use case is to just use filter().
As get() is defined as a method of the QuerySet class, at
or is there a reason that filter() allows empty result sets but
> get() does not?
>
> Thanks,
> Steve
>
> On Monday, October 23, 2017 at 2:49:28 PM UTC-7, st...@fitcode.com wrote:
>>
>> I have been tripping over the following exception
>> DoesNotExist: INSERT_YOUR_
ave been tripping over the following exception
> DoesNotExist: INSERT_YOUR_MODEL_NAME_HERE matching query does not exist.
>
> The error is source in django 1.11.2 in db.models query.py file, in the
> get(self, *args, **kwargs) function, line 378 to be exact
> ...
> raise se
I have been tripping over the following exception
DoesNotExist: INSERT_YOUR_MODEL_NAME_HERE matching query does not exist.
The error is source in django 1.11.2 in db.models query.py file, in the
get(self, *args, **kwargs) function, line 378 to be exact
...
raise self.model.DoesNotExist
ention one point that works well for me.
> If you check blob existence with:
> hasattr(widget, 'blob')
> then django responds False in the case Blob Does Not exist an True
> otherwise.
>
> At the same time DB request is performed but DoesNotExist exception
HI guis,
I need to mention one point that works well for me.
If you check blob existence with:
hasattr(widget, 'blob')
then django responds False in the case Blob Does Not exist an True
otherwise.
At the same time DB request is performed but DoesNotExist exception is not
raised.
O
On Friday, August 12, 2016 at 1:19:17 PM UTC-6, Todor Velichkov wrote:
>
> Some more code will be helpful, for example the model structure, how do
> you define the the `ForeignKey`? How do you subscribe for the signal?
> You are saying that with sleep(1) the code works fine, is this mean that
>
Some more code will be helpful, for example the model structure, how do you
define the the `ForeignKey`? How do you subscribe for the signal?
You are saying that with sleep(1) the code works fine, is this mean that
you can reproduce the problem at any time?
However test it without fetching the bl
Hey all,
I'm quite stumped with a problem that recently started showing up in my
code. I have a model called a Widget that can have an associated Blob
object. When a Widget is deleted, I want to make sure that the Blob
associated with it isn't used elsewhere, and if it's not, delete it. I do
t
> File
"/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line
334, in get
>
> self.model._meta.object_name
>
> DoesNotExist: Group matching query does not exist.
>
>
> Can someone help me ?
>
BTW, this is a standard exception raised b
Thanks for your reply,
It was in the DB but, I don't know why, I had this issue. I made the
migration a second time and this time, it worked.
Thanks,
Robin.
-- Solved.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this g
getattr(self.get_queryset(), name)(*args, **kwargs)
>
> File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py",
> line 334, in get
>
> self.model._meta.object_name
>
> DoesNotExist: Group matching query does not exist.
>
>
> Can someone help me ?
>
&
thod
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py",
line 334, in get
self.model._meta.object_name
DoesNotExist: Group matching query does not exist.
Can someone help me ?
Thanks,
Robin.
--
ogin/?next=/admin/ HTTP/1.1" 500 152252
> [13/Jul/2015 20:42:11]"GET /favicon.ico HTTP/1.1" 404 1936
>
> submit the url http://localhost:8000/admin/ in browser I got error
> below:
>
> DoesNotExist at /admi/login/
> Site matching query does not exist.
> Request Met
CONTROL-C.
[13/Jul/2015 20:42:10]"GET /admin/ HTTP/1.1" 302 0
[13/Jul/2015 20:42:10]"GET /admin/login/?next=/admin/ HTTP/1.1" 500 152252
[13/Jul/2015 20:42:11]"GET /favicon.ico HTTP/1.1" 404 1936
submit the url http://localhost:8000/admin/ in browser I got error b
"C:\...\models.py", line 42, in __unicode__
> t = self.data_type
> File "C:\Python27\lib\site-packages\django\db\models\fields\related.py",
> line
> 389, in __get__
> raise self.field.rel.to.DoesNotExist
> DoesNotExist
>
> How would I correctly writ
\site-packages\django\db\models\fields\related.py",
line
389, in __get__
raise self.field.rel.to.DoesNotExist
DoesNotExist
How would I correctly write the error handling? This does not quite work:
try:
t = self.data_type
except self.data_type.DoesNotExist:
Hi Chris,
Am 2012-12-13 19:39, schrieb Chris Cogdon:
This will depend on the problem, but let me site a simple example for how this
is often
solved.
[...]
I hope that gives you sufficient options.
Yes, it does; I guess I'll just have to experiment with locking the "input"
rows a bit. :-)
On Thursday, December 13, 2012 10:23:52 AM UTC-8, Carsten Fuchs wrote:
>
> Our database is Oracle;
> with
> <
> https://docs.djangoproject.com/en/1.4/ref/models/querysets/#select-for-update>
>
>
> saying both "Returns a queryset that will lock rows ..." and "All
> matched entries will be loc
Hi Chris,
thank you very much for your reply!
Am 12.12.2012 22:42, schrieb Chris Cogdon:
The question is going to be very database specific. "select for update"
works by putting in row-level locks in the database. If the row does not
exist, then it won't get a lock on it, and I know of no datab
The question is going to be very database specific. "select for update"
works by putting in row-level locks in the database. If the row does not
exist, then it won't get a lock on it, and I know of no databases that will
maintain the query so that any newly created rows automatically get a lock
ments"), or else completes and updates the cache.
The problem is that the long and expensive computation that is indicated
with the ### comment lines can run long enough so that another view
request can enter the same code in the meanwhile.
As a result, CE.save() can be called twice. (I
n app in tutorial 2, I got this error
> >> page with the message stated in subject line.
> >>
> >> Here's more info:
> >>
> >> Django: latest version from the trunk
> >> Python: 2.6.1
> >> OS: OSX 10.6.7
> >>
> >> Here's
I found the same thing in my code. Changed it, and seems to be working
fine so far. Thanks a lot!
On Oct 21, 6:36 am, Torsten Bronger
wrote:
> Hall chen!
>
>
>
>
>
>
>
>
>
> Alasdair Nicol writes:
> > Hi Jo o and Torsten,
>
> > [...]
>
> >> On Oct 7, 12:31 pm, Torsten Bronger
> >> wrote:
>
> >>>
Hallöchen!
Alasdair Nicol writes:
> Hi João and Torsten,
>
> [...]
>
>> On Oct 7, 12:31 pm, Torsten Bronger
>> wrote:
>>
>>> Hall chen!
>>>
>>> I examine a traceback that ends with
>>>
>>> ...
>>>
>>> File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line 351,
>>> in ge
r():
clone = clone.order_by()
num = len(clone)
if num == 1:
return clone._result_cache[0]
ifnotnum:
raise self.model.DoesNotExist("%s matching query doesnotexist."
% self.model._meta.object_name)
Hallöchen!
João Pedro Francese writes:
> I've just stumbled upon the same problem in my code. I have no
> clue on why it happened either. Did you ever get any progress on
> investigating this issue?
No, I have not investigated this further so far. (But I still know
how to reproduce it.) At fir
if self.query.can_filter():
> clone = clone.order_by()
> num = len(clone)
> if num == 1:
> return clone._result_cache[0]
> ifnotnum:
> raise self.model.DoesNotExist("%s matching query doesnotexist."
>
Hallöchen!
I examine a traceback that ends with
...
File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line
351,
in get
% (self.model._meta.object_name, num, kwargs))
TypeError: 'DoesNotExist' object is not callable
The error-tr
e with the message stated in subject line.
>>
>> Here's more info:
>>
>> Django: latest version from the trunk
>> Python: 2.6.1
>> OS: OSX 10.6.7
>>
>> Here's the info it gives me:
>>
>> DoesNotExist at /admin/
>> Site
tated in subject line.
>>
>> Here's more info:
>>
>> Django: latest version from the trunk
>> Python: 2.6.1
>> OS: OSX 10.6.7
>>
>> Here's the info it gives me:
>>
>> DoesNotExist at /admin/
>> Site
o: latest version from the trunk
> Python: 2.6.1
> OS: OSX 10.6.7
>
> Here's the info it gives me:
>
> DoesNotExist at /admin/
> Site matching query does not exist.
It looks like it's related to the sites framework:
http://docs.djangoproject.com/en/dev/ref/contrib/
he info it gives me:
DoesNotExist at /admin/
Site matching query does not exist.
Traceback:
File "/Users/nightition/Development/django-trunk/django/core/handlers/
base.py" in get_response
111. response = callback(request,
*callback_args, **callback_kwargs)
Fil
On Wed, Jul 7, 2010 at 6:22 PM, Nick wrote:
> I am working on a form to resend an account activation email for newly
> registered users who did not receive their first email.
>
> The form is currently raising a DoesNotExist error and I can't figure
> out why:
>
> H
get a different DoesNotExist error, it jumps right over the
custom validation error.
So the custom ValidationError triggers when there is a profile in the
DB and the default debug page DoesNotExist triggers when there isn't a
FulLProfile associated with the email address.
On Jul 7, 12:42 pm, Nuno M
At a glance:
> try:
> FullProfile.objects.get(email=email)
> except FullProfile.DoesNotExist:
>
> test =
> FullProfile.objects.get(email=self.cleaned_data['email'])
> raise forms.ValidationError("%s" % (test))
Shouldn't the second FullProfile.objects.get
l 7, 2010 at 1:22 PM, Nick wrote:
> I am working on a form to resend an account activation email for newly
> registered users who did not receive their first email.
>
> The form is currently raising a DoesNotExist error and I can't figure
> out why:
>
> Here is the activatio
I am working on a form to resend an account activation email for newly
registered users who did not receive their first email.
The form is currently raising a DoesNotExist error and I can't figure
out why:
Here is the activation code:
class resend_activation(forms.Form):
Am Freitag 28 Mai 2010, 14:43:21 schrieb Daniel Roseman:
> On May 28, 1:33 pm, Dirk Eschler wrote:
> > how to fetch the DoesNotExist exception generated by
> > get_object_for_this_type? Being generic i can't use the actual model.
[...]
> The DoesNotExist exceptions for ea
On May 28, 1:33 pm, Dirk Eschler wrote:
> Hello,
>
> how to fetch the DoesNotExist exception generated by get_object_for_this_type?
> Being generic i can't use the actual model.
>
> I tried something like that, but i doesn't seem to work, the original
> exce
Hello,
how to fetch the DoesNotExist exception generated by get_object_for_this_type?
Being generic i can't use the actual model.
I tried something like that, but i doesn't seem to work, the original
exception is still raised.
from django.contrib.contenttypes.models import Conten
ow, of course I would like to check whether the object identified by
> > 'pk' is in the database, and return a suitable error message if that
> > fails; I was halfway expecting to find a "has_key() / exists() / ..."
> > method, but it seems the only way to hand
quot;
> method, but it seems the only way to handle this gracefully is by
> catching the DoesNotExist exception?
>
> I have never really got very friendly with exceptions, I tend to
> consider them as something exceptional which "should not" happen,
> whereas the fact th
On Apr 10, 8:30 am, Kevin Teague wrote:
> There is nothing exceptional about exceptions in Python. McDonc does a
> good job at explaining how to think about exceptions as less than
> exceptional:
>
> http://plope.com/Members/chrism/exceptions_arent_errors/view
>
> The only arguably exceptional par
There is nothing exceptional about exceptions in Python. McDonc does a
good job at explaining how to think about exceptions as less than
exceptional:
http://plope.com/Members/chrism/exceptions_arent_errors/view
The only arguably exceptional part is that ideally the ORM would raise
a plain KeyErro
On Fri, Apr 9, 2010 at 4:54 PM, Joakim Hove wrote:
> I have never really got very friendly with exceptions, I tend to
> consider them as something exceptional which "should not" happen,
> whereas the fact that the database does not contain a particular key
> is in my opinion something quite ordina
at
> fails; I was halfway expecting to find a "has_key() / exists() / ..."
> method, but it seems the only way to handle this gracefully is by
> catching the DoesNotExist exception?
>
> I have never really got very friendly with exceptions, I tend to
> consider them as something ex
like to check whether the object identified by
'pk' is in the database, and return a suitable error message if that
fails; I was halfway expecting to find a "has_key() / exists() / ..."
method, but it seems the only way to handle this gracefully is by
catching the DoesNotExis
On Mon, Apr 5, 2010 at 11:33 AM, zweb wrote:
> after some debugging, just found out that
> filter method does not throw DoesNotExist while get does.
get() returns a single object. If a single object does not exist, you
get a DoesNotExist exception. This is documented:
after some debugging, just found out that
filter method does not throw DoesNotExist while get does.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe
Hi Daniel
many thanks...
that help me a lot..
now it works.. ;-)
ivan
>
> That method should have gone in the TipoIndagine model.
> --
> DR.
>
--
Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
Preferisco formati liberi.
Please try to avoid to send me .dwg, .doc, .xls, .pp
t; File "", line 1, in
> File "/usr/lib/python2.6/dist-packages/django/db/models/query.py",
> line 69, in __repr__
> return repr(data)
> File "/usr/lib/python2.6/dist-packages/django/db/models/base.py",
> line 345, in __repr__
> u = unicod
db_django/geotec_db/
models.py", line 92, in __unicode__
return u'%s' % self.cod_tipo
File "/usr/lib/python2.6/dist-packages/django/db/models/fields/
related.py", line 264, in __get__
raise self.field.rel.to.DoesNotExist
DoesNotExist
I can't underst
On Tue, Feb 2, 2010 at 5:17 PM, OkaMthembo wrote:
> Hi Kathy,
>
> Thanks for looking into it. When i paste it into the cmd as an argument to
> dir, i still get File Not Found (specific screen shot attached).
>
>
So really, that file doesn't exist. What is the real full name of the file
you have
:O Did i say "Kathy"? The horror! Am terribly sorry, Karen. It's very late
here and i'm seeing double vision :)
On Tue, Feb 2, 2010 at 11:37 PM, Karen Tracey wrote:
> On Tue, Feb 2, 2010 at 4:18 PM, OkaMthembo wrote:
>
>> [snip]
>
> Template Loader Error:
>> Django tried loading these templates
Hi Kathy,
Thanks for looking into it. When i paste it into the cmd as an argument to
dir, i still get File Not Found (specific screen shot attached).
On Tue, Feb 2, 2010 at 11:37 PM, Karen Tracey wrote:
> On Tue, Feb 2, 2010 at 4:18 PM, OkaMthembo wrote:
>
>> [snip]
>
> Template Loader Error:
On Tue, Feb 2, 2010 at 4:18 PM, OkaMthembo wrote:
> [snip]
Template Loader Error:
> Django tried loading these templates, in this order:
> Using loader django.template.loaders.filesystem.load_template_source:
> *c:\projects\sasalaries\sasalaries\mytemplates\polls\index.html (File does
> not exis
Hi folks,
I am doing the Django tutorial (part 3 _ Django Documentation.htm).
I created an HTML template in a folder within my Django project/ site
(C:\Projects\SASalaries\sasalaries\mytemplates\polls) and my TEMPLATE_DIRS
setting in settings.py is as follows:
TEMPLATE_DIRS = (
*"C:/Projects
Hi folks,
I am doing the Django tutorial (part 3 _ Django Documentation.htm).
I created an HTML template in a folder within my Django project/ site
(C:\Projects\SASalaries\sasalaries\mytemplates\polls) and my TEMPLATE_DIRS
setting in settings.py is as follows:
*TEMPLATE_DIRS = (
"C:/Projects
e 257, in __get__
> > rel_obj = QuerySet(self.field.rel.to).get(**params)
>
> > File "/usr/local/lib64/python2.5/site-packages/django/db/models/
> > query.py", line 305, in get
> > % self.model._meta.object_name)
>
> > DoesNotExist: Employee matching
.5/site-packages/django/db/models/
> query.py", line 305, in get
> % self.model._meta.object_name)
>
> DoesNotExist: Employee matching query does not exist.
>
> [snip]
>
> ...also, this only happens with the approval and final_approval
> models...the request model wo
l in chain(self.choices, choices):
File "/usr/local/lib64/python2.5/site-packages/django/forms/
models.py", line 915, in __iter__
yield self.choice(obj)
File "/usr/local/lib64/python2.5/site-packages/django/forms/
models.py", line 922, in choice
return (key, self.field.la
Ok...I'm sorry. The change list page is what I'm referring to...I'll
try to gather some info and post it.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from thi
On Mon, Jan 11, 2010 at 2:59 PM, kkerbel wrote:
> When viewing the admin pages for a travel request app we wrote, the
> admin page shows the record links, however, when you click to view the
> details of any record, I get an error stating "DoesNotExist: Employee
> matching que
When viewing the admin pages for a travel request app we wrote, the
admin page shows the record links, however, when you click to view the
details of any record, I get an error stating "DoesNotExist: Employee
matching query does not exist." I've looked at the database and the
emplo
The way to do what you're trying to do is to take advantage of the
following:
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
In brief, you'll create another model, which will then be specified in
your settings.py by AUTH_PROFILE_MODULE. From then
The way to do what you're trying to do is to take advantage of the
following:
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
In brief, you'll create another model, which will then be specified in
your settings.py by AUTH_PROFILE_MODULE. From then
m/hold/101036/
5) In settings.py I wrote:
AUTHENTICATION_BACKENDS = (
'myproject.auth_backends.CustomUserModelBackend', )
CUSTOM_USER_MODEL = 'myproject.profile.UserProfile'
Then, when I go to login, write mi name and password, y the system returns
the following error:
'
m/hold/101036/
5) In settings.py I wrote:
AUTHENTICATION_BACKENDS = (
'myproject.auth_backends.CustomUserModelBackend', )
CUSTOM_USER_MODEL = 'myproject.profile.UserProfile'
Then, when I go to login, write mi name and password, y the system returns
the following error:
'
In that case you can create an abstract model class and use that instead of
models.Model:
class MyModel(models.Model):
class Meta:
abstract = True
class DoesNotExist(Exception):
pass
On Wed, Aug 19, 2009 at 1:22 PM, Idan Gazit wrote:
>
> Yes, and then I also n
xcept MyModel.FrobNotAllowed:
# handle the exception...
It's not a big deal but I figured that emulating the framework isn't a
bad idea.
On Aug 19, 5:03 pm, Joshua Russo wrote:
> All you really need is:
>
> class DoesNotExis
'FrobNotAllowed', MyExceptionClass)
>return new_class
>
> Is this the pattern I should be emulating for the kind of thing I'm
> seeking?
All you really need is:
class DoesNotExist(Exception):
pass
I generally create a Utils app in my project with a modelUtils.p
Hey all,
I'd like to add some custom exception to a model of mine,
Foo.FrobNotAllowed, along the lines of ModelName.DoesNotExist.
>From looking at models/base.py, it looks like the pattern is to
override __new__() and use add_to_class. Something like:
def __new__(cls, name, bases, attrs):
n
t; be 8. And the the page response will be the 8th book in the database.
> > This works fine as long as there is an 8th book in the database.
> > If there isn't a 8th book in the database, it will throw an 500 error like
> > this:
>
> > DoesNotExist at /books/8
okID is a \d. In a url like thiswww.example.com/books/8bookID will
> be 8. And the the page response will be the 8th book in the database.
> This works fine as long as there is an 8th book in the database.
> If there isn't a 8th book in the database, it will throw an 500 error like
>
> Hah! Incredibly simple! I love Django!
I had a few moments like that in the past few days :-)
Regards,
Wayne
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
sponse('book.html', {'book': book})
>>
>> DoesNotExist at /books/8
>> Books matching query does not exist.
>>
>> How do I make it redirect to a 404 instead?
>
> There is a convenient Django shortcut for this. If you update your
> function as follows
> I have a function that looks like this:
>
> def getBook(request, bookID):
> book = Books.objects.get(id=bookID)
> return render_to_response('book.html', {'book': book})
>
> DoesNotExist at /books/8
> Books matching query does not exist.
&g
will be the 8th book in the database.
This works fine as long as there is an 8th book in the database.
If there isn't a 8th book in the database, it will throw an 500 error like this:
DoesNotExist at /books/8
Books matching query does not exist.
How do I make it redirect to a 404 instead?
I hav
seems to have done the trick.
>
> [EMAIL PROTECTED] wrote:
>
>> I'm not sure where you got that code snippet from, but DoesNotExist is
>> an attribute on model classes, so that shoul read:
>>
>> except Tag.DoesNotExist.
>>
>> On Dec 8, 2:52 pm,
I just want to catch the exception thrown when the query returns nothing.
Thanks, that seems to have done the trick.
[EMAIL PROTECTED] wrote:
> I'm not sure where you got that code snippet from, but DoesNotExist is
> an attribute on model classes, so that shoul read:
>
> except
I'm not sure where you got that code snippet from, but DoesNotExist is
an attribute on model classes, so that shoul read:
except Tag.DoesNotExist.
On Dec 8, 2:52 pm, Info Cascade <[EMAIL PROTECTED]> wrote:
> How do I import the DoesNotExist exception?
>
> This doesn
How do I import the DoesNotExist exception?
This doesn't seem to work:
> from django.db.models.query import DoesNotExist
> try:
> tag = Tag.objects.get(name=cat_name)
> except DoesNotExist:
> # do something else
Doesn&
On Sun, Jun 15, 2008 at 1:40 AM, Szymon <[EMAIL PROTECTED]> wrote:
> What I need to import to handle DoesNotExist in process_exception?
> Because DoesNotExist is part of every single model, so I can't import
> it from model, because I don't know which model raises e
Hello,
What I need to import to handle DoesNotExist in process_exception?
Because DoesNotExist is part of every single model, so I can't import
it from model, because I don't know which model raises exception.
--~--~-~--~~~---~--~~
You received th
this was a really stupid mistake :)
thanks for correcting me!
V
On May 30, 12:20 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On May 30, 11:08 am, "Viktor Nagy" <[EMAIL PROTECTED]> wrote:
>
> > IndexError: list index out of range
>
> > I've tried to catch IndexError as well, but it fails wit
s a queryset. Methods on querysets that return
new querysets never raises DoesNotExist.
See which methods that returns what on:
http://www.djangoproject.com/documentation/db-api/
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
Y
On May 30, 11:08 am, "Viktor Nagy" <[EMAIL PROTECTED]> wrote:
> IndexError: list index out of range
>
> I've tried to catch IndexError as well, but it fails with the same error
> try:
> q = models.Queue.objects.filter(type=type, status=0)[0]
> except models.Queue.DoesNotExist, IndexErr
Hi,
I have the following code in my views.py
...
try:
q = models.Queue.objects.filter(type=type, status=0)[0]
except models.Queue.DoesNotExist:
return WebAPIResponseError(request, DOES_NOT_EXIST)
...
this would give back the first result that corresponds to type=type
and has status 0.
I
Okay, solved this. It was the offending latest(). I thought it
returned a QuerySet, but I was badly mistaken. I don't even know how I
got the idea... :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" g
ue).filter(category__published=True)
def get_hot(self):
return
self.get_query_set().filter(is_hot=True).latest('published_on')
Now, I'm not sure if this was the code that returns the DoesNotExist
exception, but the get_query_set() function de
may be a bit misleading).
The DoesNotExist exception is also raised when I call a generic view w/
o extra context when I have no news items in the database (this is not
a ciritical bug, though).
I will double-check my custom manager code to make sure it uses
filter(), but I don't think t
1 - 100 of 124 matches
Mail list logo