django

django internationalisation not working

I have done django internationalization.My application is working fine.I am missing something in my settings.py file .If i change the locale of my browser the django admin text is changing but my code text is not changing.But if i write language_code="ja-JP" then my text is also changing but this is wrong way.Below is my sample settings ...

Django date filter: how come the format used is different from the one in datetime library ???

Hello ! For formatting a date using date filter you must use the following format : {{ my_date|date:"Y-m-d" }} If you use strftime from the standard datetime, you have to use the following : my_date.strftime("%Y-%m-%d") So my question is ... isn't it ugly (I guess it is because of the % that is used also for tags, and therefore is ...

Editing django code within django - Django

Hi folks, just wondering if it would be possible in some experimental way, to edit django app code within django safely to then refresh the compiled files. Would be great if someone has tried something similar already or has some ideas. I would like to be able to edit small bits of code from a web interface, so I can easily maintain a...

Why are my column sorts slow in Django Admin, only 1 problem table

I have a table (MySQL) with 10K+ records. Not a huge table. When working with the table in Django's Admin, the default sort order, the page loads blazing fast. Hardly noticeable. But if I attempt to sort by any column, say by ID column or even a date column, it can take over a minute to return results. Other tables work fine Any c...

Django InlineModelAdmin - set inline field from request on save (set user field automatically) (save_formset vs save_model)

I have two models, a MainModel and a related InlineModel that i'd like to show as an inline in the admin. This InlineModel can be used for, say, making notes about the model and should track the logged in admin user making changes. While this seems simple (and indeed, the docs show an example for this when the user field is part of the M...

Django authentication in django nonrel on GAE

I'm using the Django nonrel project on a google app engine project running locally in development. I've created my own models and these are fine when they are saved and retrieved in the datastore. I'm hoping to use django.contrib.auth to provide the user functionality. I can use the shell to create users and these get assigned an ID. Wh...

How do I set up a test duplicate of a Django and Postgresql based web application?

Not sure if this is an excessively broad and newbie-ish question for Stack Overflow but here goes: I paid someone else to build a web application for me and now I want to tweak certain aspects of it myself. I learn best by trial and error – changing stuff and seeing what happens. Obviously that's not a great way to treat a live site, so...

jQuery form generation

I'm basically looking for the client-side equivalent of Django's ModelForm: I want to be able to specify the general schema of my data (what the fields are, which ones are required, what kinds of fields to use, etc.), and I want to be able to dynamically generate the form, itself, fill it with any initial data, validate it, and extract a...

how to customize django admin for clickable list_editable

Hi all, Currently, i have a class MyAdmin(admin.ModelAdmin), and i have a field in there called name, which belongs to both list_editable and list_display. The current behavior is such that all fields that is in list_editable displays a form field. However, i would like to change that only when people click on the field would it turn in...

where is everything in django admin?

Hi all, I would like to figure out where everything is in django admin. Since i am currently trying to modify the behavior rather heavily right now, so perhaps a reference would be helpful. For example, where is ModelAdmin located, i cannot find it anywhere in C:\Python26\Lib\site-packages\django\contrib\admin. I need that because i wou...

Comparing two large sets of attributes

Suppose you have a Django view that has two functions: The first function renders some XML using a XSLT stylesheet and produces a div with 1000 subelements like this: <div id="myText"> <p id="p1"><a class="note-p1" href="#" style="display:none" target="bot">✽</a></strong>Lorem ipsum</p> <p id="p2"><a class="note-p2" href="#" s...

Django Form Preview

I'm trying to use django's FormPreview and I can't get it to work properly. Here's my code: forms.py class MyForm(forms.ModelForm): status = forms.TypedChoiceField( coerce=int, choices=LIST_STATUS, label="type", widget=forms.RadioSelect ...

how to get the upload progress in django?

i want to make a upload progress bar, but i don't know how to get the upload progress of the file or image that is uploading, someone know how can i do this with Django?? thanks and sorry for my english! ...

How exactly does a python (django) request happen? does it have to reparse all the codebase?

With a scripting language like python (or php), things are not compiled down to bytecode like in .net or java. So does this mean that on every request, it has to go through the entire application and parse/compile it? Or at least all the code required for the given call stack? ...

In django models, how to make all table names not have the app label?

I have a database that was already being used by other applications before i began writing a web interface with django for it. The table names follow simple naming standards, so the django model Customer should map to the table "customer" in the db. At the same time I'm adding new tables/models. Since I find it cumbersome to use app_cust...

List of Django model instance foreign keys losing consistency during state changes.

I have model, Match, with two foreign keys: class Match(model.Model): winner = models.ForeignKey(Player) loser = models.ForeignKey(Player) When I loop over Match I find that each model instance uses a unique object for the foreign key. This ends up biting me because it introduces inconsistency, here is an example: >>> def print...

How to fetch only specific columns of a table in django?

Hi all, I have a small question regarding the Django database query system. I have seen that most of the code we find over internet, forums or even in a tutorials, it uses queries like : user = User.objects.all() or User.objects.filter(username = username) but this will fetch all the columns of the table even if we do not need all th...

javscript delay output

I have written some code to display server's current date and time on browser every time user clicks the button . I have done this using ajax in django with the help of jquery. Now my, problem is I have to continously display the date and time once the button is clicked . Some Sample code or utilities allowing such kind of delay will be...

using javascript with help of jquery

Code written by me based on previous suggestions as follows . Any help to efficinetly use jquery in order to make this code work . Thanks in advance $(document).ready(function() { self.setInterval("clock()",1000); $("button").click(function() { clock; ...

Features/Projects that exist in RoR but not in Django

I am looking for projects or features that exist in Ruby on Rails but not in Django. ...