Using the following models: class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): name = models.CharField(max_length=100) �...
FileSystemStorage contains the following: def _open(self, name, mode='rb'): return File(open(self.path(name), mode)) ..which is used to open files which are stor...
Otherwise it ends up with a shallow copy which reuses the same attrs dict across separate widget instances, playing merry hell with form classes which want to change widget attrs on a per-(form)...
When using attribute docstrings in my models they will never be picked up by doctools as the attributes disappear top level from the model. This makes me to keep separate documentation and code ...
Currently the workflow for comment moderation might look like this (without knowing the comment moderation admin actions ;)): Look at the overview page If in doubt open the comment in a new page...
If a main template renders a sub-template with a modified or newly created context, test client's response.context fails to include the modified context. An example using {% with %} and {% inclu...
We need to pass extra context in admin action delete_selected, just like admin view's delete_view.
Hi All, I tried to import a 3.2GB xml file, partly to see if Django loads the whole file into memory when it's importing and partly to see how large pg client transactions work. Whichever cau...
If you have an abstract class with ManyToManyField it is possible to user %(class)s in related_name for generic related name. Same should be possible for through, to define a generic name for th...
verbose_name of meta data for models should allow dynamical translation based on a number of elements through ungettext and not just two possibilities of verbose_name and verbose_name_plural whi...
Form fields used by list_editable in the admin can be customized by overriding the formfield_for_dbfield method on a ModelAdmin. Somtimes, though, you want to use a different customized field in...
Django and its community have a pretty strong focus on the concept of reusable applications: applications as pluggable behavior blocks, independent from one another and from projects. And the te...
I have tried icontains and regex against a TextField on an oracle database and get the following error: DatabaseError: ORA-06502: PL/SQL: numeric or value error: character string buffer too s...
Unlike a plain ForeignKey field which uses a select box, the raw_id_fields listing/search interface requires that the user has change permissions on the model in your ForeignKey.
Lines 93-102 of the expressions model test define the following test case: # F expressions cannot be used to update attributes which are foreign keys, or # attributes which inv...
Flushing and cycling the session should empty the data in the session and create a new key, but should not delete the old key. Scenario: 1: JS kicks off a periodic AJAX request to update s...
In between test cases, the cache should be flushed in order to prevent one test case from polluting another, similar to how the database is currently flushed (or transactions rolled back) in Dja...
The function the calculates the last_modified date will always run but since the cache_page decorator ends up calling a middleware it will get to the last_modified and etag headers first. It wil...
Action 'delete_selected' calls ModelAdmin's has_delete_permission method only once without obj argument. (This action is run from object list with checked records) It is problem if has_delete_pe...
Only in the list_display does the admin interface show DecimalField with precision of .00. In the view of an object in the Model, 0.00, for example, would be shown as 0, without the precision. I...
Currently, when defining a ForeignKey/OneToOneField field XXX, Django automatically defines a XXX_id attribute to store the id value. However, it is sometimes desirable to decide of the name as...
Admin website for group provides only possibility of setting the name and permission, but there is no widget for adding users (from the whole list of users) to the group. When there are lots of ...
I have a few generic models with foreign keys (simplified for this example): class Country(turbia_models.Model): name = turbia_models.CharField(max_length=50, unique=True) class ...
I wish Site instances could make (real) absolute URLs (e.g. http.../path/) based on a given relative path like /path/. And a template tag to make it nicer from templates, too: {% site_url ... %}...
I recently tried to delete an object in the admin that had several million related objects. The server quickly ran out of memory as the apache process's memory usage ballooned upwards to near...
I am currently creating an extension to the ModelForm that provides similar features to Admin such as fieldsets. Unfortunately, the ModelFormMetaclass does not provide easy way of extending Mode...
As described in this post on the django-users group, raising django.core.files.uploadhandler.StopUpload(connection_reset=True) in order to cut off a too-large file upload does not work as...
ModelAdmin.queryset() is used both in the changelist and change object views. Suppose some fields are deferred in the returned queryset to speed up changelist rendering. As a result, the obje...
I've got a patch for a slight behavior modification that I needed and that might be useful for others, and I wanted to collect some thoughts on it before writing up the regression tests and docu...
When passing a translated string to a select box using a Forms Select widget, the output string still contains accent HTML entity codes. For example: "Problemas para el Inicio de Sesió...
Provide a declarative mechanism to define modelformsets or inlineformsets. The attached patch allows definitions like this: class AuthorForm(forms.ModelForm): class Meta: ...
add_view and change_view have the following code: ModelForm = self.get_form(request) ... form = ModelForm(request.POST, request.FILES) or: form = ModelForm(initial=initial) or: ...
Saving FileFields with a none value sets the field to a empty string in the db and not NULL as it should.
EDIT: scroll to comment 13 to see what this ticket is about. Referencing a OneToOneField with null=True (i.e. it's optional) when there is no value set will return None, as expected. However,...
The following patch adds support for dynamically adding radiobutton items to the admin page. Without this patch the newly added item through the popup menu does not get added to the page and ...
Ticket #2705 is a very good idea I think. PostgreSQL supports SELECT ... FOR SHARE locking mode, which is basically the same as FOR UPDATE mode but it does not conflicts with other transacti...
Annotating across multiple tables results in wrong answers. i.e. In : total = Branch.objects.all().annotate(total=Sum('center__client__loan__amount')) In : total.total Out: 3433000 In...
It would be nice if generic foreign keys could have a nice widget for the admin, right now they aren't very usable.
Right now any other if type node that wants to exist needs to re-implement all the rendering logic of the if tag, in addition to the conditional it wants to use. To simplify this we could make I...
I was not able to format URL for Admin interface to prefill DateTimeField with given value. It worked in 0.96, but does not work in 1.0 ( I used ../admin/MyApp/MyTable/add/?box=359&datum_date...
Firstly, this is a known problem, see groups.google.com/group/django-users/browse_thread/thread/2936ad3387c4b369. Secondly, I disagree with the ‘You set the database collation and Django re...
FieldFile's _get_size, like many of its methods, passes the operation on to its Storage object. However, in this case, assuming that a storage mechanism can easily discover the size of a file by...
Transferring a side-issue from #3414 (comment 23 over there): Note: the WSGI spec allows PATH_INFO to be empty or missing; specifically: "This may be an empty string, if the request URL t...
My colleague Javier de la Rosa has enhanced the calendar shown in admin's date fields to allow navigation through years, and not only through months. This requires changing calendar.js and DateT...
I have a custom Form for one of my models (in the example SecondModel) that adds one choice field with an initial value. If I use that model/form as an inline formset and I exclude the extra fie...
I'm not a python wizard, so I'm just suspecting the following is possible: When you examine connection.queries, it would be great to write out the file and the line, from the Query comes from...
In essence, I'm simply trying to add a new media type to a number of custom widgets. However, I'm finding that I have to re-implement large parts of Media and MediaDefiningClass, and I even have...
In presence of model inheritance, we need to propagate signal not only to handlers, attached to the Child classes, but also to handlers, attached to the Parent class. Please, see unittests in...
If I have a template # template1.html Line 1 Line 2 And I include this template in other one using templatetag include: # template2.html {% include template1.html %} Line 3 The o...
It will be very good if there is some possibility to mark sort of "conditional content" of the template blocks ({% block .. %}), that is the content that is displayed only if in a child template...
Though it works just fine to set the value of a field in the admin with URL arguments (i.e. adding '?title=foo' to your URL sets the value of the field 'title' to 'foo'), this doesn't work if th...
Currently, inclusion tags are not very reusable since they are bound to a template at registration time. For example, the only way to customize Djagno admin's change_list_results.html template i...
Currently, admin.TabularInline and admin.StackedInline do not support inlines themselves. This would allow nested inlines to happen.
This feature has been needed for some time, and was recently requested. See: http://groups.google.com/group/django-users/browse_thread/thread/36242edfd0d0281c?hl=en I've started a basic p...
Background: I noticed this when playing with save_formset() on ModelAdmin in order to modify the data for a FileField on an inline model before it gets sent to S3 via a custom filestorage backen...
There should be a way to set a default list_filter in the admin interface. For example, if I had a model like this: DECOM_CHOICES = ( ('N', 'No'), ('Y', 'Ye...
This was a feature request and relates to the changeset in #1390 . The goal is to produce specified results for the Recent Actions panel (sidebar) to only display logged actions for that part...
Hello, everytime when I use Admin to view a table, the Admin count the rows in the table. if the database is mysql+innodb, this step is very slow, how about add an option in Meta to prevent t...
im attaching a patch that could make it work
See http://code.djangoproject.com/wiki/ReplacingGetAbsoluteUrl
IMO ordered_forms attribute needs to be available even then the formset.is_valid() result to false in order to return the formset in order for re-inputting purpose
While trying to get the cookie test in the login form working again by default (see ticket #8061 ) I think I found a way to get rid of the set_test_cookie() / test_cookie_worked() dance. The ...
A current limitation of the unit test framework is that there is no capacity to define 'test models' - that is, models that are only required for the purposes of testing. A regular installation ...
This new backend uses Oracle session pool to improve database performance in threaded environment. Overall speedup for large amounts of small queries is 2-3 times.
As it exists now, multi-table inheritance does not allow for the creation of a child model instance that inherits from an existing parent model instance. For example: Parent Class- class P...
If a table contains a foreign key that refers to another table that sits outside the schema, that index includes a '.' in the table name. Suppose our current schema is schema1: CREATE TABLE ...
If I have two ModelForm: class AForm(ModelForm): class Meta: model = A class BForm(ModelForm): class Meta: model = B class CForm(AFor...
SUMMARY Being the case that the application server's hostname may not necessarily be a valid fully qualified domain name (FQDN) the use of socket.getfqdn() in defining DNS_NAME may yield a numb...
If you have: class MyModel(Model): user = ForeignKey(User, related_name='my_models', null=True) You can't use a pre_delete signal to set user.my_models.clear() because the check...
Add two parameters to the JS calendar class: highlighting a selected date, and disabling dates before a specified one.
The admin interface makes use of various template tags that are opaque, and make customization difficult. An example from admin/change_list.html: {% block result_list %}{% result_list ...
I'm using django as a library in my non-web-based application. As such I prefer not to use the 'django' gettext domain but my own. I currently work around it with some symlinking trickery since ...
I found a bug when using the has_permission method of the AdminSite class to filter which users can access the admin page: class SuperuserAdminSite(admin.AdminSite): def has_permissi...
Using % in database column names (specified using db_column) causes the database wrapper to fail when preparing queries. This is because the % symbol is not properly quoted (as %%), and confl...
There is frequently a need for Django to access data from tables in other schemas; this is especially true when building Django apps on top of legacy databases. Currently, the proposed solution ...
I want to use the collapse feature of the admin, but not have the field initially collapsed, so I made this little patch. It adds a "collapsible" class that does just that. It also patches th...
When passed a single argument, the cycle tag should treat it as an iterable to cycle through. For example, with the context: {'colors': } you should be able to have a template like: {% f...
This patch adds the possibility to clear(refresh) cached data per view. SmileyChris sugested it would be good to add another key to the cached keys where we could keep track of all the differ...
cache_page, gzip_page, and conditional_page all use decorator_from_middleware. decorator_from_middleware wraps the view function to simulate middleware being run on a per-view basis. Here'...
In some cass it is useful to be able to store meta information on models inside the model class. In Django the Meta subclass is used to achieve this. Trying to add a custom attribute to a model'...
Django should really have a DATABASE_CHARSET / DATABASE_COLLATION setting in the settings.py as well as a setting for the mysql database engine. It's stunning that unittests can enforce a databa...
There is a difference between models and forms, now the preferred format is: class Contact(models.Model): email = models.CharField(verbose_name=_('email')) class ContactForm(forms...
The Web framework for perfectionists with deadlines.
I'd recommend to add a call to add_domain() to the enclosure URL because other URLs are also automatically extended with the site's URL. I've included the patch.
In newforms-admin, it would be quite helpful to be able to specify both a models' fields and its inline models' fields in the fields tuple of the options class. This would allow inline model fie...
Django's handling of i18n is fairly good, but one major point that it doesn't handle well (together with almost everything else out there) is the formatting of dates. The most obvious example...
calling "manage.py syncdb log" with my log model on an empty Oracle database yields the following exception Traceback (most recent call last): File "./manage.py", line 11, in ? ...
At present, Atom feed support is limited to a small number of fields and it is difficult to do things like generate full-content feeds. I'm offering to improve Atom feed support by implementi...
Currently the DatabaseWrapper (at least for the postgresql) does not pass args and kwargs for cursor() calls to the underlying database adapter. This makes it impossible to use the adapter fully...
I didn't like it was missing. oracle, mssql : add a FulltextIndex for the Fields postgresql: for each FulltextField add a extra tsvector Field named like "%(fieldname)_tsv" Problems wit...
The admin log currently only provides way to show changes across all sites. For a project with multiple sites, it'd be very nice to be able to tell the admin log template tag to only show change...
It doesn't seem possible to use the 'default' option to pre-select values in the admin site for a ManyToManyField. I've tried a string value, a list of strings, and even (following a recommendat...
How to use namespace? For example, {% load example %} {% example.testtag %} And I think if the namespace can be optional is better. I don't know if it's useful, but sometimes I read oth...
My Django installation is SVN Revision: 3238 Filtering models by a ManyToMany field does not appear to work. See Google groups thread http://groups.google.com/group/django-users/browse_thr...
When creating a simple model with a non-integer primary key, the Admin interface shows the field as editable, but when making a change, it seems to execute an incorrect query. For example: ...
Pre-MR, adding order_with_respect_to would present an ordering field in the admin interface (or a draggable list of inline objects if dom-drag.js was installed). Post M-R, neither appears. Not s...
The permissions don't get translated/localized in the admin interface (in User and Group model).
Currently, certain RSS and Atom elements can be populated only by making use of the "low-level" feed framework; this is particularly annoying in the case of certain common items such as the RSS ...
Allow manytomany relationships to be defined both ways E.G class ItemType(meta.Model): name = meta.CharField(maxlength=100) descritpion = meta.CharField(maxlength=250) cl...
In the interest of being able to use Django as an admin interface for any db schema, it really should support multiple column primary keys. Currently, you can "fake" it by declaring one of th...