I've done that because I want to change the default error_message and
I do not know who to do it :(. I've tried error_messages={} in the
field but it is now recognized in Fields in ModelForms only in plain
Forms. So, how can I change the default error_message if I'm using
ModelForms?
> Why are doi
Hi!
I'm testing a Django application where I'm using i18n.
The problem is with a test that says that a word with an accent
(spanish) is the same as a word without an accent. And although I have
established my own error messages it shows other error message when
using a word with accents.
The proble
Hi!
Is there any way to access request.session from a unit test if I have
a response that is a HttpResponseRedirect. I know HttpResponse have
the attribute session but HttpResponseRedirect does not. I've read
that HttpResponseRedirect is a subclass of HttpResponse, can I access
to the HttpResponse
Hello all,
I have two models called User and Responsible. When I add a
Responsible automatically a User is added. I have only one form to add
a User and a Responsible.
class NewUserResponsibleForm(forms.Form):
username = forms.CharField(max_length=30)
password = forms.CharField(max_length
You are saying that a Pupil is a Team and a Team is a Pupil with that
OneToOneField. In the Team you are saying one Pupil belongs to many
Teams and a Team have many Pupils that seems ok but the OneToOneField
seems wrong.
2008/10/25 AdamC <[EMAIL PROTECTED]>:
>
> 2008/10/25 Manuel Held <[EMAIL PRO
In fact it was not the solution. I though that it was because when I
browsed to localhost:8000/admin/ I saw the login form but after
logging in the error appeared another time.
Today I'm going to start a project from the beggining and I'm going to
copy the files one by one trying to isolate the e
Uhm, the solution was to delete the database and recreate it. Now it
runs correctly.
2008/7/21 Florencio Cano <[EMAIL PROTECTED]>:
> Hi,
> After viewing the new documentation for the admin interface and
> modifying, properly I think, the files when I try to access
> http://lo
t this for admin:
('^admin/(.*)', admin.site.root),
2008/7/21 cschand <[EMAIL PROTECTED]>:
>
> Did you add
> admin.autodiscover()
> in urls.py? I think the problem due to this
> read
> http://www.djangoproject.com/documentation/admin/#hooking-adminsite-instances-into-your-urlconf
hange I see is
extracting the Admin class from the models and creating another class
called MyModelAdmin that extends admin.ModelAdmin and modifying the
urls.py to include:
urlpatterns = patterns('',
('^admin/(.*)', admin.site.root),
[...]
Any ideas to solve this problem
Hi!
I have updated Django from svn, installed a new app and some new
models and now when I try to browse /admin/ I get this error:
ViewDoesNotExist: Tried index in module
django.contrib.admin.views.main. Error was: 'module' object has no
attribute 'index'
I have checked that my user is the owner
Hi!
When I try to test a post to a form that have a ModelChoiceField form
I get always a form error in that field "Select a valid choice".
The form is this:
class OperacionForm(forms.Form):
ticker = forms.ModelChoiceField(Valor.objects.all())
fecha = forms.DateField(widget=SelectD
Hi,
I would like to know how I can retrieve the user id of the user
authenticated in the auth subsystem after login in a test.
class CrearCarteraTestCase(TestCase):
fixtures = ['/fixtures/initial_data.xml']
def setUp(self):
self.client = Client()
Hello,
I have a model Investor associated with a model User. Now I'm
implementing the registration form.
I want to store the name of the Investor in the Investor model and the
rest of information in the User model. So I have username, password,
name and email.
I have a registration form in order t
Hello,
I have this piece of code:
from django import newforms as forms
class RegistroForm(forms.Form):
username = forms.CharField(max_length=30)
password = forms.CharField(max_length=20, widget=forms.PasswordInput())
nombre = forms.CharField(max_length=50)
email =
I had 'es_ES'. I have reviewed
http://www.i18nguy.com/unicode/language-identifiers.html and I see
that for spanish (Spain) I have to use 'es-ES' so I change it, execute
manage.py syndb and execute the tests but I get the same. Now I try
with 'es'. The same process and I get the same...Could be the
Hi!
In my app when I show the errors in errorlist because a wrong filled
form it shows them in spanish (my language) but when I execute the
tests (with assertContains) the messages in errorlist appear in
english!
How can I fix this?
--~--~-~--~~~---~--~~
You receiv
I'm trying to understand Django forms and I have a doubt.
Imagine that you define a Form class called AddressClass.
You can instantiate it like this:
address_form = AddressClass()
address_form will be an unbound form object and when you if you show
it in the template all the fields will be blank
Hello,
I'm writing some tests to my login views and I get this error when
executing the tests:
AttributeError: 'UserTestCase' object has no attribute 'assertRedirects'
This is the view:
import unittest
from django.test.client import Client
from django.contrib.auth.models import User
class User
What do you mean with "importing your models"? Do you mean syncing
them with the database? Have you tried $ python manage.py validate?
2008/6/18 Molly <[EMAIL PROTECTED]>:
>
> I am creating an app to be run on the desktop,
>
> I am in the process of importing my models, and I got this error:
>
>
I think you should map first the form to an object and then access the
name attribute of that object instance. It seems that you are trying
to access a model.CharField() directly.
On 18 jun, 00:43, redmonkey <[EMAIL PROTECTED]> wrote:
> I have two fields in a model, a name (CharField) and a descr
Have you tried this?
for border in country_instance.contries.all():
border.length = new_border
On 18 jun, 10:39, Peter Bulychev <[EMAIL PROTECTED]> wrote:
> Is it possible to insert additional row into table, which corresponds
> to ManyToManyField?
--~--~-~--~~~-
I don't understand what exactly are you trying to do but I think the
dictsort filter could help.
On 18 jun, 09:53, laspal <[EMAIL PROTECTED]> wrote:
> I have a list of employee and i want to sort it.
--~--~-~--~~~---~--~~
You received this message because you are
Here http://www.djangoproject.com/documentation/authentication/ you
can find information about authentication in Django. Hope this helps.
2008/4/17 Fernanda Boronat <[EMAIL PROTECTED]>:
>
> Hello, I am trying to develop a small application that allows
> authentication, the idea is that I have a
23 matches
Mail list logo