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

2022-09-13 Thread Jaap van Wingerde
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

Re: DoesNotExist at /

2020-12-28 Thread tech george
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 >>

Re: DoesNotExist at /

2020-12-28 Thread tech george
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

Re: DoesNotExist at /

2020-12-28 Thread AMRIT SHAHI
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

Re: DoesNotExist at /

2020-12-28 Thread Prashanjeet Halder
.@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

DoesNotExist at /

2020-12-27 Thread tech george
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

Re: How to debug? -- DoesNotExist at /admin/login/

2018-05-11 Thread mynoveltrans
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 "

Re: DoesNotExist behavior in db.models query.py

2017-10-23 Thread James Schneider
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(

Re: DoesNotExist behavior in db.models query.py

2017-10-23 Thread steve
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

Re: DoesNotExist behavior in db.models query.py

2017-10-23 Thread 'Aaron C. de Bruyn' via Django users
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_

Re: DoesNotExist behavior in db.models query.py

2017-10-23 Thread steve
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

DoesNotExist behavior in db.models query.py

2017-10-23 Thread steve
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

Re: DoesNotExist on ForeignKey Access

2016-08-12 Thread Todor Velichkov
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

Re: DoesNotExist on ForeignKey Access

2016-08-12 Thread Constantine Covtushenko
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

Re: DoesNotExist on ForeignKey Access

2016-08-12 Thread TheBeardedTemplar
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 >

Re: DoesNotExist on ForeignKey Access

2016-08-12 Thread Todor Velichkov
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

DoesNotExist on ForeignKey Access

2016-08-12 Thread TheBeardedTemplar
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

Re: DoesNotExist: Group matching query does not exist.

2015-11-12 Thread James Schneider
> 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

Re: DoesNotExist: Group matching query does not exist.

2015-11-12 Thread Robin Fourcade
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

Re: DoesNotExist: Group matching query does not exist.

2015-11-11 Thread Vijay Khemlani
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 ? > &

DoesNotExist: Group matching query does not exist.

2015-11-11 Thread Robin Fourcade
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. --

Re: How to debug? -- DoesNotExist at /admin/login/

2015-07-14 Thread Sergiy Khohlov
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

How to debug? -- DoesNotExist at /admin/login/

2015-07-13 Thread elim
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

Re: handling field DoesNotExist error within a model class

2013-11-01 Thread Simon Charette
"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

handling field DoesNotExist error within a model class

2013-11-01 Thread Rick Shory
\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:

Re: select_for_update().get(...), what happens on DoesNotExist?

2012-12-15 Thread Carsten Fuchs
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. :-)

Re: select_for_update().get(...), what happens on DoesNotExist?

2012-12-13 Thread Chris Cogdon
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

Re: select_for_update().get(...), what happens on DoesNotExist?

2012-12-13 Thread Carsten Fuchs
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

Re: select_for_update().get(...), what happens on DoesNotExist?

2012-12-12 Thread 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 databases that will maintain the query so that any newly created rows automatically get a lock

select_for_update().get(...), what happens on DoesNotExist?

2012-12-12 Thread Carsten Fuchs
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

Re: Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2012-08-25 Thread Maximiliano Mussuto
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

Re: Strange traceback: DoesNotExist not callable

2011-10-21 Thread João Pedro Francese
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: > > >>>

Re: Strange traceback: DoesNotExist not callable

2011-10-21 Thread Torsten Bronger
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

Re: Strange traceback: DoesNotExist not callable

2011-10-20 Thread Alasdair Nicol
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)

Re: Strange traceback: DoesNotExist not callable

2011-10-20 Thread Torsten Bronger
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

Re: Strange traceback: DoesNotExist not callable

2011-10-20 Thread João Pedro Francese
      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." >    

Strange traceback: DoesNotExist not callable

2011-10-07 Thread Torsten Bronger
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

Re: Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2011-05-18 Thread Ivan Galic
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

Re: Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2011-05-18 Thread Ivan Galic
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

Re: Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2011-05-17 Thread Gabriel Gunderson
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/

Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2011-05-17 Thread igalic
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

Re: Query raises a DoesNotExist error

2010-07-08 Thread Tom Evans
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

Re: Query raises a DoesNotExist error

2010-07-07 Thread Nick
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

Re: Query raises a DoesNotExist error

2010-07-07 Thread Nuno Maltez
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

Re: Query raises a DoesNotExist error

2010-07-07 Thread Bill Freeman
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

Query raises a DoesNotExist error

2010-07-07 Thread Nick
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):

Re: Fetch DoesNotExist from get_object_for_this_type

2010-05-28 Thread Dirk Eschler
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

Re: Fetch DoesNotExist from get_object_for_this_type

2010-05-28 Thread Daniel Roseman
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

Fetch DoesNotExist from get_object_for_this_type

2010-05-28 Thread Dirk Eschler
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

Re: Is the DoesNotExist exception the only way to check if an object exists?

2010-04-10 Thread greatlemer
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

Re: Is the DoesNotExist exception the only way to check if an object exists?

2010-04-10 Thread Daniel Roseman
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

Re: Is the DoesNotExist exception the only way to check if an object exists?

2010-04-10 Thread Matt Schinckel
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

Re: Is the DoesNotExist exception the only way to check if an object exists?

2010-04-09 Thread Kevin Teague
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

Re: Is the DoesNotExist exception the only way to check if an object exists?

2010-04-09 Thread Tom X. Tobin
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

Re: Is the DoesNotExist exception the only way to check if an object exists?

2010-04-09 Thread johan sommerfeld
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

Is the DoesNotExist exception the only way to check if an object exists?

2010-04-09 Thread Joakim Hove
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

Re: ORM: get, filter and DoesNotExist

2010-04-04 Thread Russell Keith-Magee
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:

ORM: get, filter and DoesNotExist

2010-04-04 Thread zweb
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

Re: doesNotExist

2010-04-03 Thread ivan marchesini
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

Re: doesNotExist

2010-04-03 Thread Daniel Roseman
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

doesNotExist

2010-04-03 Thread Imuvy
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

Re: Trouble with the Django tutorial: Template DoesNotExist(1.1 on Win XP, Python 2.5.4)

2010-02-02 Thread Karen Tracey
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

Re: Trouble with the Django tutorial: Template DoesNotExist(1.1 on Win XP, Python 2.5.4)

2010-02-02 Thread OkaMthembo
: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

Re: Trouble with the Django tutorial: Template DoesNotExist(1.1 on Win XP, Python 2.5.4)

2010-02-02 Thread OkaMthembo
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:

Re: Trouble with the Django tutorial: Template DoesNotExist(1.1 on Win XP, Python 2.5.4)

2010-02-02 Thread Karen Tracey
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

Trouble with Django tutorial: Template DoesNotExist (1.1 on Win XP, Python 2.5.4)

2010-02-02 Thread OkaMthembo
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

Trouble with the Django tutorial: Template DoesNotExist(1.1 on Win XP, Python 2.5.4)

2010-02-02 Thread OkaMthembo
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

Re: Viewing details on a record in admin pages gives DoesNotExist error

2010-01-11 Thread kkerbel
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

Re: Viewing details on a record in admin pages gives DoesNotExist error

2010-01-11 Thread Karen Tracey
.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

Re: Viewing details on a record in admin pages gives DoesNotExist error

2010-01-11 Thread kkerbel
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

Re: Viewing details on a record in admin pages gives DoesNotExist error

2010-01-11 Thread kkerbel
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

Re: Viewing details on a record in admin pages gives DoesNotExist error

2010-01-11 Thread Karen Tracey
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

Viewing details on a record in admin pages gives DoesNotExist error

2010-01-11 Thread kkerbel
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

Re: Problems with custom Auth Backends: 'NoneType' object has no attribute 'DoesNotExist'

2009-10-10 Thread Shawn Milochik
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

Re: Problems with custom Auth Backends: 'NoneType' object has no attribute 'DoesNotExist'

2009-10-09 Thread Shawn Milochik
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

Problems with custom Auth Backends: 'NoneType' object has no attribute 'DoesNotExist'

2009-10-08 Thread Sandra Django
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: '

Problems with custom Auth Backends: 'NoneType' object has no attribute 'DoesNotExist'

2009-10-02 Thread Sandra Django
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: '

Re: Adding model-specific exceptions like DoesNotExist?

2009-08-19 Thread Joshua Russo
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

Re: Adding model-specific exceptions like DoesNotExist?

2009-08-19 Thread Idan Gazit
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

Re: Adding model-specific exceptions like DoesNotExist?

2009-08-19 Thread Joshua Russo
'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

Adding model-specific exceptions like DoesNotExist?

2009-08-19 Thread Idan Gazit
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

Re: Error handling. Catching DoesNotExist errors.

2009-06-21 Thread Beals
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

Re: Error handling. Catching DoesNotExist errors.

2009-06-21 Thread soniiic
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 >

Re: Error handling. Catching DoesNotExist errors.

2009-06-20 Thread Wayne Koorts
> 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

Re: Error handling. Catching DoesNotExist errors.

2009-06-20 Thread Magnus Valle
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

Re: Error handling. Catching DoesNotExist errors.

2009-06-20 Thread Wayne Koorts
> 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

Error handling. Catching DoesNotExist errors.

2009-06-20 Thread Magnus Valle
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

Re: How to import DoesNotExist exception ???

2008-12-09 Thread Sérgio Durand
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,

Re: How to import DoesNotExist exception ???

2008-12-08 Thread Info Cascade
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

Re: How to import DoesNotExist exception ???

2008-12-08 Thread [EMAIL PROTECTED]
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 to import DoesNotExist exception ???

2008-12-08 Thread Info Cascade
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&

Re: How to handle all DoesNotExist?

2008-06-14 Thread Ronny Haryanto
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

How to handle all DoesNotExist?

2008-06-14 Thread Szymon
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

Re: IndexError instead of DoesNotExist with filter( )[0]

2008-05-30 Thread V
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

Re: IndexError instead of DoesNotExist with filter( )[0]

2008-05-30 Thread Christian Joergensen
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

Re: IndexError instead of DoesNotExist with filter( )[0]

2008-05-30 Thread Daniel Roseman
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

IndexError instead of DoesNotExist with filter( )[0]

2008-05-30 Thread Viktor Nagy
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

Re: extra_context and DoesNotExist exception

2008-04-10 Thread foxbunny
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

Re: extra_context and DoesNotExist exception

2008-04-10 Thread foxbunny
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

Re: extra_context and DoesNotExist exception

2008-04-10 Thread foxbunny
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   2   >