Using the testing framework how can we make sure that the correct view
got called.
Documentation at http://www.djangoproject.com/documentation/testing/#testcase
says that
(django.test.client can be used to) "Test that the correct view is
executed for a given URL.", but I can't figure out how.
--~
Thanks, Panos. Just took a quick look - the settings context processor
is useful, but still requires explicit addition into each view using
that template.
The generic_content tags fit my examples, and probably for most use-
cases, but I don't know... I'm not comfortable in putting logic that
spec
Just wanted to let you know that fixed the problem.
Thanks so much.
Jeff
-- Original message --
From: "Karen Tracey" <[EMAIL PROTECTED]>
On Dec 25, 2007 9:18 PM, <[EMAIL PROTECTED]> wrote:
After reloading the page the browser does not show the new data.
Here is the od
> Is it possible to get the "/subDir/djangoApp" prefix removed from the
> URL before the rest of django handles the URLs !?
Yes, at least I think you can. (Note: I haven't actually tested this,
and it feels a bit kludgey, but it's where I would start.)
In http://www.djangoproject.com/documentat
I found the issue (or non issue, whatever you like ;))
get_test_char_display() calls the field's choices with a string (of
course it is a CharField), which results in the following call
(stripped down talen from django/db/models/base.py:
dict(choices).get(value,value)
Now accesing it with a strin
Hi,
I have developped a small django app and I like it a lot.
I have tested it on a local setup using "manage.py runserver" on a
custom port.
Now I wanted to move this to our apache2 based web site and got my sys
admin convinced to install mod_python and I got a httpd.conf like
this:
. dja
> Error is in the way you use it. Please write full model and usage
> example.
As you wish :)
blubb/models.py:
from django.db import models
# Create your models here.
MY_CHOICES = (
(1, '11'),
(2, '12')
)
class TestModel(models.Model):
test_blubb = models.IntegerField(choices=MY_C
On Dec 29, 2007 7:18 AM, beewee <[EMAIL PROTECTED]> wrote:
> it works now when calling the connection._commit() function (which is
> completely undocumentated) after executing the query. (I know that you
> shouldn't call functions starting with _ in general)
Were you doing anything to disable the
Error is in the way you use it. Please write full model and usage
example.
On 29 дек, 23:54, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> apollo13 pointed this out on the IRC channel:
> If your choices use an integers, get_foo_display returns the integer
> and not the "human readable" option.
apollo13 pointed this out on the IRC channel:
If your choices use an integers, get_foo_display returns the integer
and not the "human readable" option.
For example, reworking this from the docs:
YEAR_IN_SCHOOL_CHOICES = (
(1, 'Freshman'),
(2, 'Sophomore'),
(3, 'Junior'),
(4, 'Seni
On Dec 13, 10:54 am, birkin <[EMAIL PROTECTED]> wrote:
> For one of my projects I import data from a non-django-controlled
> database using the MySQLdb python library, populate adjangomodel
> object and save it (to my app's django-controlled database table).
> Works smoothly.
I did something sim
> After that I restart the server and get AttributeError at /admin/
> 'WSGIRequest' object has no attribute 'user', with traceback
> athttp://dpaste.com/29308/. Don't see the admin login screen.
Huh. This smells vaguely like a problem we ran into when we were
changing the way login authenticati
Check out Django Template Utils[1], it will probably fit your needs.
[1] http://code.google.com/p/django-template-utils/
On Dec 29, 5:42 pm, Sam Lai <[EMAIL PROTECTED]> wrote:
> Thanks Alex and hedronist. I'm leaning towards creating a generic
> template tag that loads template context processor
Is there 'django.contrib.auth.middleware.AuthenticationMiddleware' in
your MIDDLEWARE_CLASSES ?
On 29 дек, 18:10, Chris Haynes <[EMAIL PROTECTED]> wrote:
> Thanks a lot, syncdb now works with the admin stuff, and
> I entered the superuser account stuff when requested.
>
> After that I restart the
Thanks Alex and hedronist. I'm leaning towards creating a generic
template tag that loads template context processors to do this (I
don't have the complicated needs you had hedronist... as far as I
know).
I was just wondering if there was a 'best-practice' way of doing this;
looks like creating t
On Dec 29, 2007 4:39 AM, David Larlet <[EMAIL PROTECTED]> wrote:
>
> Thanks for those useful tricks. Here are some typo corrections, hope
> it helps:
>
> > [4]: http://code.djangoproject.com/wiki/CookBookNewFormsDynamicFields
>
> [4]: http://code.djangoproject.com/wiki/CookBookNewFormsFieldOrderin
Thanks a lot, syncdb now works with the admin stuff, and
I entered the superuser account stuff when requested.
After that I restart the server and get AttributeError at /admin/
'WSGIRequest' object has no attribute 'user', with traceback at
http://dpaste.com/29308/. Don't see the admin login scre
Hello,
I have this urls.py:
info_dict = { "queryset": Entry.objects.all().order_by("-
creationDate"), }
urlpatterns = patterns("",
(r'^(?P\d+)/$',
'django.views.generic.list_detail.object_detail',
{ info_dict, 'extra_context':{'CommentForm':CommentForm} }
)
My problem is that I want
Wouldn't it make sense to use the same mechanism as in the Admin
interface of the newforms-admin branch? It seems to show the current
file path as static text and somehow ignore an empty file field if the
object already has a file.
--~--~-~--~~~---~--~~
You received
Hi!
it works now when calling the connection._commit() function (which is
completely undocumentated) after executing the query. (I know that you
shouldn't call functions starting with _ in general)
--~--~-~--~~~---~--~~
You received this message because you are sub
Hi i downloaded and installed app from source code via - >
http://www.djangosites.org/s/www-lzpian-com/
it should be like-> http://www.lzpian.com/
in english version -> use : http://babelfish.altavista.com/babelfish/tr
i changed database settings
i synchronised database and the app works , but
On Dec 29, 2007 3:56 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> In case of such a user profile, would the recursive m2m relation be
> defined on the UserProfile model ?
Yes. Unless you are planning to use a customized version of
contrib.auth, you don't have any control over the User mod
Hey Ned,
On Sat, 2007-12-29 at 08:27 +1100, Malcolm Tredinnick wrote:
[...]
> def render(self, context):
>if context[self.varname] == id(context['forloop']):
> return self.nodelist_false.render(context)
>context[self.varname] = id(context['forloop'])
>
Le 29 déc. 07 à 05:25, Todd O'Bryan a écrit :
>
> After wrestling with newforms to get it to do things I thought it was
> never intended to do, I decided that either it was really intended to
> do such things or it's just such a clean design that getting it to do
> weird things isn't that hard.
>
Hi all,
I'm using Django to build a repository of scientific publications at
my university.
Now we need to edit publication records that have been supplied by our
departments and imported into the database.
I would like to be able to use the excellent Django admin interface
for this editing, but
Request Method: GET
Request URL:http://127.0.0.1:8000/people/person/
Exception Type: TypeError
Exception Value:Cannot resolve keyword '' into field. Choices are:
organizationdatabase, meterreadings, transaction, id, pid, location,
street, building, corpus, block, appart
26 matches
Mail list logo