django

Admin, two links to different views ?

Hi guys, in django admin the views that show the register's just have a link to "edit", but what happen if a need an extra(S) links to another views? for example: i have view that show the list of registered People, the nick is linking to the Edit page (the normal way of Django), but i need another links that will show me the "arti...

Building string base for Django application

I am building an application in django, that is already using a lot of hardcoded strings. They are mostly in templates, but some also in js files and a few can be found inside the code. Now every time some string needs to be changed people comes to us and we have to waste our time finding it and changing. How could I start with cleaning ...

Django find in joined set

When i have, say, a Datamodel named "Computer", and there are many Users for many Computers, I create a manytomany-relationship between "Computer" and "User". Now I want to select any Computer that is used by User 1. I tried this: computers = Computer.objects.filter(users__contains=1) But this does not seem to work since the __contain...

implementing a simple jquery function to the django admin site

Greetings I have extended my admin add screen (tabularinline) by using the http://www.djangosnippets.org/snippets/1594/ Now I have a field in my model: start = models.CharField(max_length=5) this is intended as a special time format, it will be in a HH:MM format such as 16:30 . Now I want to implement a way that site auto assigns ":"...

Get previously entered information in Django FormWizard

I'm trying to create a simple Django multi-page form using FormWizard. What the form should do is the following: Let the visitor enter first and lastname in a form. Continue to next page where entered previously firstname and lastname will be displayed, there will also be a field on this page that let's the visitor enter a message. The...

Django: Why are my forms' textfields and imagefields never instantiated but all other fields instantiate ok?

Hi, My forms' are never fully instantiated, particularly ImageFields (as how they would be like in admin), and TextFields (which appear as tags) However, all other fields are instantiated properly. May I know why this happens? Attached code that replicates this issue: #view sellerForm = SellerUpgradeForm(instance=userseller_prof)...

[Django] Can I use more than a single filter on a variable in template?

For example: {{test|linebreaksbr|safe}} ...

Django shared template

Hi, I'm looking how to do the best something like a UserControl in ASP.NET in Django. For example: 1) There's a Book model defined 2) There's a regular representation of the book which I want to use all over my site (called "book_template.html"). Now let's say I want to use this one representation from 2 views: recent_books_view, pop...

django extreme slowness

I have a slowness problem with Django and I can't find the source .. I'm not sure what I'm doing wrong, but at least twice while working on projects Django became really slow. Requests takes age to complete (~15 seconds) and Validating model when starting the development server is also very slow (12+ seconds on a quad core..) I've trie...

Is MySQL appropriate for a read-heavy database with 3.5m+ rows? If so, which engine?

My experience with databases is with fairly small web applications, but now I'm working with a dataset of voter information for an entire state. There are approximately 3.5m voters and I will need to do quite a bit of reporting on them based on their address, voting history, age, etc. The web application itself will be written with Djang...

Equivalent of Django Signals for Rails?

In Rails, the closest I've seen to Django Signals are Observers. The problem with them is that they're restricted to triggering callbacks on hardcoded events related to a model's lifecycle. Django signals can be created anywhere, triggered anywhere and handled anywhere. The model lifecycle callbacks are just regular signals that happen ...

Django re-orden form fields?

Hi guys, i have a form, but i need to re-orden the form fields, plese some body will tell me how? im try with fields = ['x','y'] but nothing happen. class DiligenciaForm(ModelForm): titulo = forms.CharField(max_length=70,help_text='Dele un nombre a su diligencia.') tipo = forms.ChoiceField(choices=TIPO) vias= forms.TypedCh...

django + jquery + and dynamic form , fields sent empty

Hi, i dont know how ill say this, but i have a Form, in this form im trying to add some fields with jquery (dynamic??) clicking a radio button, so , when im trying the send the data , django said that the fields are empty ... and in the debuger (error pages??) is tru, the fields are empty, but the fields from my Form.py they not. im new...

how validate form and show the value of the filled fields?

Hi guys, now im learning to validate form, "all" is working, im showing the erros of empty fields, but i have 2 questions: how ill show the value in the filled fields when there are errors in another fields?, like <input ... value= {{ value }} > the problem is that my fields are not html forms fields. how ill show the error exactly ove...

Django admin file upload doesn't work, how do I debug this?

I'm on Mac Leopard. Trying to get django admin file uploads, or really image uploads to work. In my app's models.py I set the field to: image = models.FileField(upload_to='images', max_length=500) (started w/ ImageField, but thought if a file doesn't work, then the image for sure won't work) It says the upload happened. Gives me a po...

How can make Django permission_required decorator not to redirect already logged-in users to login page, but display some message

How can make Django permission_required decorator not to redirect already logged-in users to login page, but display some message like Insufficient permissions? Thank you. ...

Difference between returning modified class and using type().

I guess it's more of a python question than a django one, but I couldn't replicate this behavior anywhere else, so I'll use exact code that doesn't work as expected. I was working on some dynamic forms in django, when I found this factory function snippet: def get_employee_form(employee): """Return the form for a specific Board."""...

Pinax Signup and Accounts

Does anyone know a good link to documentation about Pinax signup and "Accounts". I'm trying to work out how to implement our sign-up process in Django / Pinax and am trying to navigate my way between Django's User and Profile classes and the Account class in Pinax.. The main issue for us is we have a sign-up form with several extra ques...

implementing a javascript graph application to the existing admin panel's listing view

Hello I want to implement a javascript graph plot application (ie http://people.iola.dk/olau/flot/examples/turning-series.html) to the existing admin view, where the instances of a model at the listing view also showing charts of these items and can be filtered through by using the already implemented list_filter option which I added at...

Django validate and go back to preview URL ?

Hi guys, im asking again :), i don't know how make this. My English is not too good, but ill try to asking this: how ill validate a form and go back to the preview url (the same view form) and show the validation errors?, im asking this because i have 2 form's, the first form's action is going to a second form (POST), but in this secon...