tickets_full

3,604 rows where resolution = "duplicate"

View and edit SQL

Suggested facets: stage, type, severity, easy, has_patch, needs_better_patch, needs_tests, needs_docs, ui_ux, created (date), changetime (date), last_pulled_from_trac (date)

resolution

  • duplicate · 3,604
id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
4 2005-07-13 19:08:10 2005-09-16 17:01:24 2019-06-24 00:15:18.878694 Design decision needed closed Core (Cache system) enhancement normal   duplicate Add a db cache backend We should have a db cache backend -- this will be very useful for people who can't/won't run memcached. jacob adrian     0 0 0 0  
15 2005-07-13 19:22:11 2006-08-29 10:03:03 2019-06-24 00:15:25.937537 Unreviewed closed Metasystem defect normal   duplicate Metasystem unique_together doesn't work for an object that's related inline See {{{unique_together}}} in {{{music.MusicianInBand}}}, which causes this when ManipulatorAdd is instantiated: {{{ Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/worldonline/cms/core/handler.py", line 123, in get_response return callback(request, **param_dict) File "/usr/lib/python2.3/site-packages/worldonline/cms/views/admin/main_new.py", line 608, in change_stage manipulator = mod.ChangeManipulator(object_id) File "/usr/lib/python2.3/site-packages/worldonline/cms/models/meta.py", line 77, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/usr/lib/python2.3/site-packages/worldonline/cms/models/meta.py", line 1008, in manipulator_init self.fields.extend(f.get_manipulator_fields(rel_opts, self, name_prefix='%s.%d.' % (rel_opts.object_name.lower(), i), rel=True)) File "/usr/lib/python2.3/site-packages/worldonline/cms/models/meta.py", line 1279, in get_manipulator_fields params['validator_list'].append(getattr(manipulator, 'isUnique%sFor%s' % (i, j))) AttributeError: BandManipulatorChange instance has no attribute 'isUniquemusician_idForband_id' }}} adrian adrian   0 0 0 0 0 0
20 2005-07-13 19:32:17 2007-07-03 23:03:44 2019-06-24 00:15:29.178930 Ready for checkin closed contrib.admin enhancement normal   duplicate "Add another" for many-to-many relationships Django already creates an "Add another..." link in one-to-many select boxes. (Example: The "place" select box on the "Add event" admin page has an "Add another..." link at the bottom of it.) Many-to-many fields -- represented in the admin as multi-select boxes -- also need "Add another..." capability. It could probably appear as the last entry in the select box, as in the one-to-many add-anothers. adrian adrian   0 0 0 0 0 0
22 2005-07-13 19:33:33 2008-10-06 03:46:01 2019-06-24 00:15:30.495546 Unreviewed closed contrib.admin defect normal   duplicate [patch] FileUploadField should allow for clearing the field It's currently not possible to clear the value of a FileUploadField. adrian adrian   0 1 0 0 0 0
28 2005-07-13 19:41:08 2007-07-17 21:49:58 2019-06-24 00:15:34.418230 Accepted closed Metasystem enhancement normal   duplicate Delete confirmation should have "replace relationships" shortcut This is best explained with an example. Right now, when I click to delete a duplicate dateline, I get a list of all the news stories that feature that dateline. So I click on each story to change its dateline to the correct (non-duplicate) dateline, because if I didn't do that, deleting the dateline would delete all those stories. Then, once I've changed all the stories, I can delete the dateline safely, because it won't have any relationships. What I want is the delete-confirmation page for datelines -- and everything else -- to offer a "convert all of these stories' datelines to the following *different* dateline" select box. adrian adrian   0 0 0 0 0 0
74 2005-07-18 21:05:56 2006-10-22 16:23:53 2019-06-24 00:16:04.309683 Unreviewed closed *.djangoproject.com defect normal   duplicate add djangoproject.com templates into SVN For transparency and instruction-by-example, it would be nice to have the templates for djangoproject.com in SVN. Then people can see how brilliant minds like mine hack the template system to do terrible things. adrian wilson   0 0 0 0 0 0
87 2005-07-19 16:39:52 2007-01-17 22:12:17 2019-06-24 00:16:12.421287 Unreviewed closed Database layer (models, ORM) enhancement normal   duplicate [patch] Oracle database support Here's a patch for Oracle support. adrian jrhuggins@thoughtworks.com oracle database db sequence   1 0 0 0  
91 2005-07-19 21:45:54 2007-07-03 23:05:24 2019-06-24 00:16:15.030115 Accepted closed Core (Other) enhancement normal   duplicate A (possible) cleaner ORM fields description Here is a cleaner approach to the ORM fields. Using this patch, the example in the tutorial can be changed to this: {{{ from django.core.meta import Model # Create your models here. class Poll(Model): def fields(Field): Field.Char('question', maxlength=200) Field.DateTime('pub_date', 'date published') class Choice(Model): def fields(Field): Field.ForeignKey(Poll) Field.Char('choice', 'choice', maxlength=200, core=True) Field.Integer('votes', 'votes', core=True) }}} I have done an implementation, which is fully backwards compatible, and quite simple. {{{ Index: django/core/meta.py =================================================================== --- django/core/meta.py (revision 227) +++ django/core/meta.py (working copy) @@ -377,12 +377,53 @@ new_v.func_globals[k] = func new_functions[k] = func + +class FieldGenerator(object): + """FieldGenerator is used for... uh... Generating fields. It has attributes, + such as "Char" and "DateTime", that can be used to create class instances such as + "CharField" or "DateTimeField". These instances are then added to the list "fields", + which can be retrieved to be used as the "fields" attribute in a Model class.""" + def __init__(self): + self.fields = [] + self.last_class = None #This is the class obj that corrisponds to the last __getattr__ call. + + def __getattr__(self,name): + self.last_class = None + try: + obj = eval(name+"Field") + if issubclass(obj,Field): self.last_class = obj + except NameError: pass + if not self.last_class: # If name+"Field" didn't work, just try name. + try: + obj = eval(name) + if issubclass(obj,Field): self.last_class = obj + except NameError: pass + if not self.last_class: + raise AttributeError("Could not find either %s or %sField (or they are not decendants… adrian mmarshall   0 0 0 0 0 0
104 2005-07-20 06:12:21 2007-07-03 23:04:05 2019-06-24 00:16:23.173999 Design decision needed closed Core (Other) defect normal 1.0 duplicate i18n for internal strings Maybe it would be a good idea to start using gettext for internal string resources, so people could start translating stuff? I think especially about internal strings like those in the validators. adrian hugo i18n 0 0 0 0 0 0
111 2005-07-20 14:38:19 2006-10-07 16:23:30 2019-06-24 00:16:27.508998 Unreviewed closed contrib.admin defect normal   duplicate Filtering doesn't clean up arguments When selecting different filters (DateTimeField-based, in this case), in order: * Today: ?datetime__day=20&datetime__month=7&datetime__year=2005 * Then, past 7 days: ?datetime__day=20&datetime__gte=2005-07-13&datetime__month=7&datetime__lte=2005-07-20%2023:59:59&datetime__year=2005 It seems any new arguments should clean up arguments that concern the same field. adrian Manuzhai   0 0 0 0 0 0
124 2005-07-20 21:39:32 2007-07-03 23:04:49 2019-06-24 00:16:35.707785 Ready for checkin closed Core (Other) defect normal   duplicate Better handling of raw POST data I'll come up with a patch for this, if slashzero doesn't. adrian Manuzhai   0 0 0 0 0 0
139 2005-07-21 17:21:05 2007-07-23 08:32:14 2019-06-24 00:16:45.031570 Unreviewed closed contrib.admin enhancement normal   duplicate edit_inline should grow some Javascript magic to increase usability The edit_inline functionality is very nice, but I want more: * When I start typing in the last "Choices" field, I want a new, blank Choice entry to automagically appear below it. * When a new Choice entry appears, I want it properly inserted into the tab order so that I can just hit Tab and move to the new entry. In other words, it should be possible to create a new Poll, click on the first Choice tab, and start typing: Strongly agree <tab> 0 <tab> Agree <tab> 0 <tab> No opinion <tab> 0 <tab> Disagree <tab> 0 <tab> Strongly disagree <tab> 0 <enter> This would make adding an arbitrary number of choices much more streamlined. Currently I have to click the "Save and continue Editing" button after adding each choice, which means my hands have to leave the keyboard and travel over to the mouse. tmervyn@gmail.com rmunn@pobox.com edit_inline 0 0 0 0 0 0
142 2005-07-21 19:14:25 2007-07-03 23:03:55 2019-06-24 00:16:46.955511 Unreviewed closed Documentation defect normal   duplicate tutorial 1 bug in init --settings In tutorial1, rev 253, line 77: django-admin.py init --settings='myproject.settings.main' should be: django-admin.py init --settings=myproject.settings.main With Windows XP, Python 2.4.1, Django rev 282, I get this error when the quotes are present: {{{ C:\MyStuff\projects\django>c:\Python24\python.exe C:\Python24\Lib\site-packages\ django-1.0.0-py2.4.egg\django\bin\django-admin.py init --settings='myapp.setting s.admin' Traceback (most recent call last): File "C:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\bin\django-a dmin.py", line 103, in ? main() File "C:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\bin\django-a dmin.py", line 68, in main ACTION_MAPPING[action]() File "c:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\core\managem ent.py", line 278, in init from django.core import db, meta File "c:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\core\db\__in it__.py", line 16, in ? from django.conf.settings import DATABASE_ENGINE File "c:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\conf\setting s.py", line 34, in ? raise EnvironmentError, "Could not import %s '%s' (is it on sys.path?): %s" % (ENVIRONMENT_VARIABLE, me.SETTINGS_MODULE, e) EnvironmentError: Could not import DJANGO_SETTINGS_MODULE ''myapp.settings.admin '' (is it on sys.path?): No module named 'myapp.settings.admin' }}} When I remove the quotes, I don't get an error, and my database is initialized correctly. {{{ C:\MyStuff\projects\django>c:\Python24\python.exe C:\Python24\Lib\site-packages\ django-1.0.0-py2.4.egg\django\bin\django-admin.py init --settings=myapp.settings .admin C:\MyStuff\projects\django> }}} jacob Jason Huggins tutorial django-admin init settings 0 0 0 0 0 0
144 2005-07-21 23:29:46 2007-07-03 23:04:25 2019-06-24 00:16:48.176067 Accepted closed contrib.admin defect normal   duplicate Some admin media files are not viewable When viewing the Polls site in tutorial 2 under "Click the 'What's up?' poll to edit it:" paragraph, I noticed that a few of the icons were missing (the save button, the checkbox icon when saving an item, the right side of the history button, etc.). The CSS and JS seem to load correctly, and the icons you have sourced at http://media.ljworld.com/ also load correctly. The problem lies with the CSS file which doesn't correctly go to http://media.ljworld.com/. Just to test, I changed the url to the tool-right.gif file in the css to http://media.ljworld.com/img/admin/tool-right.gif and it worked. adrian sdelatorre@gmail.com   0 0 0 0 0 0
152 2005-07-22 11:33:45 2006-06-12 10:47:10 2019-06-24 00:16:53.134903 Design decision needed closed Core (Other)   normal   duplicate FCGI server for django Maybe the FCGI-WSGI-Server at [http://svn.saddi.com/py-lib/trunk/fcgi.py] might be useable for django? A runfcgi command for django-admin might run along the following lines: {{{ def runfcgi(): "Starts a FCGI server for production use" from django.core.servers.fcgi import WSGIServer from django.core.handlers.wsgi import WSGIHandler WSGIServer(WSGIHandler()).run() runfcgi.args = '' }}} adrian gb@bofh.ms   0 0 0 0 0 0
164 2005-07-22 18:01:43 2005-07-26 16:08:52 2019-06-24 00:17:00.966083 Unreviewed closed Core (Cache system) defect normal   duplicate mysql/pgsql not implemented in django.core.cache? Am I just missing it? It looks like only simple and memcache are implemented. If so, the docs should reflect this. jacob sway   0 0 0 0 0 0
167 2005-07-22 21:33:35 2006-11-06 11:07:20 2019-06-24 00:17:02.889507 Unreviewed closed Metasystem defect normal   duplicate ForeignKey should also take string arg instead of class name Some ForeignKey relationships might be circular, due to the somewhat linear fashion of source code, this doesn't work so well. For example, you could have a Person and an Address, with a Person living at an Address as well as the Address having an owner who is, incidentally, a Person. It would be nice if {{{ ForeignKey('Person') }}} would be supported as well as {{{ ForeignKey(Person) }}} but according to jacobkm, that might not work. In which it would be {{{ ForeignKey('app.people') }}} to make it easier on the black magic scripts to find the right model. adrian Manuzhai   0 0 0 0 0 0
177 2005-07-24 19:22:36 2007-07-03 23:04:25 2019-06-24 00:17:09.182816 Ready for checkin closed contrib.admin defect minor   duplicate Logout from Admin leaves you in /admin/logout If you logout from the admin interface, your browser (konq & moz) is left in /admin/logout/ and you can't log back in until you manually go to /admin adrian EABinGA   0 0 0 0 0 0
182 2005-07-24 22:35:09 2014-12-16 17:04:41 2019-06-24 00:17:12.331820 Unreviewed closed Tools defect normal   duplicate Add a command to django-admin.py that will install missing tables Since right now django can't alter tables on the fly, though I have ideas as to how that could be done, could a command be added to django-admin.py that will add any *missing* tables to the database, or just specified tables. That way, while we're protoyping we can just drop tables and add the new ones without much hassle. adrian Moof <moof@metamoof.net>   0 0 0 0 0 0
229 2005-07-29 22:21:58 2006-09-14 02:10:12 2019-06-24 00:17:42.249909 Unreviewed closed contrib.admin defect trivial   duplicate Some images are linked-in externally in Admin interface {{{ Index: django/conf/admin_media/js/SelectFilter2.js =================================================================== --- django/conf/admin_media/js/SelectFilter2.js (revision 347) +++ django/conf/admin_media/js/SelectFilter2.js (working copy) @@ -51,7 +51,7 @@ quickElement('h2', selector_available, 'Available ' + field_name); var filter_p = quickElement('p', selector_available, ''); filter_p.className = 'selector-filter'; - quickElement('img', filter_p, '', 'src', 'http://media.ljworld.com/img/admin/selector-search.gif'); + quickElement('img', filter_p, '', 'src', '/media/img/admin/selector-search.gif'); filter_p.appendChild(document.createTextNode(' ')); var filter_input = quickElement('input', filter_p, '', 'type', 'text'); filter_input.id = field_id + '_input'; @@ -73,7 +73,7 @@ quickElement('h2', selector_chosen, 'Chosen ' + field_name); var selector_filter = quickElement('p', selector_chosen, 'Select your choice(s) and click '); selector_filter.className = 'selector-filter'; - quickElement('img', selector_filter, '', 'src', 'http://media.ljworld.com/img/admin/selector-add.gif', 'alt', 'Add'); + quickElement('img', selector_filter, '', 'src', '/media/img/admin/selector-add.gif', 'alt', 'Add'); var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); to_box.className = 'filtered'; var clear_all = quickElement('a', selector_chosen, 'Clear all', 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from");})()'); Index: django/conf/admin_media/js/admin/add_calendars.js =================================================================== --- django/conf/admin_media/js/admin/add_calendars.js (revision 347) +++ django/conf/admin_media/js/admin/add_calendars.js (working copy) @@ -64,7 +64,7 @@ … adrian deric   0 0 0 0 0 0
232 2005-07-30 11:28:38 2007-07-03 23:05:43 2019-06-24 00:17:44.130111 Accepted closed Documentation defect critical   duplicate session example. have django session support??? if yes then why don't have a session example??? if don't have a sesion support (in "user space") then add that criticaly. kd. ps. sorry for my en_US :) i'm not from en_US-country :) jacob kd. sesion,example 0 0 0 0 0 0
246 2005-08-02 04:05:48 2006-10-07 12:39:23 2019-06-24 00:17:52.957139 Unreviewed closed Metasystem defect minor   duplicate Can't do circular ForeignKey relationships between classes Example case: * class Person belongs to a Company: ForeignKey(Company) * class Company designates a contact Person: ForeignKey(Person) However, each class requires the other to be defined first. How does one implement this? adrian matt@culturethree.com model circular foreign key 0 0 0 0 0 0
250 2005-08-02 18:07:20 2007-03-26 10:42:03 2019-06-24 00:17:55.388326 Unreviewed closed Metasystem enhancement normal   duplicate Metasystem needs a BinaryField The DB cache backend (see #4) is going to require a BinaryField field type. It should probably be considered "for internal use only" and not given an admin interface.   jacob   0 0 0 0 0 0
253 2005-08-02 22:58:28 2006-10-07 13:51:57 2019-06-24 00:17:57.296435 Unreviewed closed contrib.admin defect normal   duplicate Admin add interface is looking for key that doesn't exist I'm extending tutorial and I've stumbled upon strange behaviour. I added 2 new classes: 'Answer' and 'Exercise'. When I use admin interface to add new 'Exercise' I get following error: There's been an error: {{{ Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 63, in get_response return callback(request, **param_dict) File "/usr/lib/python2.4/site-packages/django/views/admin/main.py", line 768, in add_stage new_object = manipulator.save(new_data) File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line 3, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/usr/lib/python2.4/site-packages/django/core/meta/__init__.py", line 1414, in manipulator_save obj_list = DotExpandedDict(new_data.data)[rel_opts.object_name.lower()].items() KeyError: 'answer' }}} I am using development web server. New entries to 'Exercise' do get added, despite the error, I can also edit them, add 'answers ' and update them. Clearing database (mysql4) and using `init` and `install` gives the same errors. Also adding new exercises, gives always the samer error. Here is my code listing: {{{ gandalf@a1200:/home/stat/webroot/anketa/apps/polls/models$ cat polls.py from django.core import meta # Create your models here. class Poll(meta.Model): fields = ( meta.CharField('question', maxlength=200), meta.DateTimeField('pub_date', 'date published'), ) admin = meta.Admin( fields = ( (None, {'fields': ('question',)}), ('Date information', {'fields': ('pub_date',), 'classes': 'collapse'}), ), list_display = ('question', 'pub_date', 'was_published_today'), list_filter = ['pub_date'], ) def __repr__(self): return self.question def was_published_today(self): return self.pub_date.date() == datetime.… adrian gandalf@owca.info   0 0 0 0 0 0
262 2005-08-04 10:20:39 2007-01-18 04:16:00 2019-06-24 00:18:02.969765 Unreviewed closed contrib.admin defect normal   duplicate editable=False doesn't show in tables that are created with edit_inline=True If you have dependend records and define fields as editable=False, those fields don't show up in the tabular edit list when using the dependend data with edit_inline=True. There should be a way to define files as not editable but to be still shown. Maybe a hide=True/False whose default is True for editable=False fields and False for editable=True fields? That way one could override the current default behaviour. adrian hugo <gb@bofh.ms>   0 0 0 0 0 0
279 2005-08-05 11:14:07 2007-07-03 23:05:10 2019-06-24 00:18:13.716386 Ready for checkin closed contrib.admin defect normal 1.1 duplicate [patch] TemplateDoesNotExist on Windows I just set up a project using the latest copy from the repository, and my settings/admin.py's TEMPLATE_DIRS ended up containing someth 'C:\dev\django-svn runk\django\conf/admin_templates', where the spaces indicate an actual tab. Oops! Replacing the line with r'C:\dev\django-svn\trunk\django\conf\admin_templates', fixed the problem. adrian garth@deadlybloodyserious.com TemplateDoesNotExist windows escaping settings admin.py 0 1 0 0 0 0
304 2005-08-11 01:25:40 2006-10-16 14:55:25 2019-06-24 00:18:30.535523 Unreviewed closed Database layer (models, ORM) defect major   duplicate Changes to auth.LogEntry in changeset [469] breaks Oracle backend. Changeset [469] added an additional "TextField" objects to the LogEntry model. In the Oracle backend (#87), I mapped TextField types in Django to the "Long" datatype in the db, because the Model documentaton suggests TextFields should be used to store (potentially large) html content. If I used any other string datatype (like varchar2), the max length of the field would be 4000 characters/bytes. That isn't good. Yet, again, Oracle stinks compared to PostgreSQL, because Oracle only allows '''one''' "Long" field type per table. If LogEntry's "object_id" needs to only hold small strings, and it is going to be less than 4000 characters, I'd suggest you change it to CharField. After changeset #469, I get this error in django-admin.py init: """ Error: The database couldn't be initialized. Here's the full exception: ORA-01754: a table may contain only one column of type LONG """ I've confirmed that changing LogEntry's object_id field to "CharField" fixes the problem for Oracle. adrian Jason Huggins oracle TextField CharField Long 0 0 0 0 0 0
308 2005-08-11 14:22:48 2006-10-07 14:53:12 2019-06-24 00:18:33.192381 Unreviewed closed contrib.admin defect normal   duplicate Adding inline-edited related records during _post_save I need to add records to a child table in the _post_save and can imagine many other situations where this process would be useful. This process itself functions as expected; however, when using the admin interface where the child table is edited inline the display of the process fails. I believe the cause of the failure to be an expectation from the admin interface that the added child record would be present on the previous page when it isn't the process fails with a {{{KeyError}}}. I've made a trivial patch to catch the error and continue but I don't have a sufficiently good understanding of Django to know whether this will cause additional problems. adrian nichyoung _post_save edit_inline 0 0 0 0 0 0
323 2005-08-15 08:23:40 2006-11-06 11:00:09 2019-06-24 00:18:42.796116 Unreviewed closed contrib.admin defect normal   duplicate Saving item without making any changes causes a duplicate item to be created in MySQL When you click on an item in the admin interface, to edit it and then press save without changing any of the data fields a new item is added rather than just saving the data back into the old item. I am using revision 492. adrian tmj@linuxmail.org   0 0 0 0 0 0
345 2005-08-17 15:38:48 2007-07-03 23:05:46 2019-06-24 00:18:56.937237 Accepted closed Core (Other) enhancement normal   duplicate Set http Content-type header from settings.py It would be nice if you could set the default content-type for http-served pages in a settings module somewhere. I'll try to write a patch. adrian tim@gerla.net   0 0 0 0 0 0
353 2005-08-18 10:36:25 2005-08-18 12:45:34 2019-06-24 00:19:01.996248 Unreviewed closed Database layer (models, ORM) defect normal   duplicate mysql breaks on model sqlite3 likes {{{ C:\dev\pytagger-svn>update At revision 535. At revision 535. C:\dev\pytagger-svn>django-admin.cmd sqlall tags C:\dev\pytagger-svn>python23 c:\dev\django-svn\trunk\django\bin\django-admin.py sqlall tags BEGIN; CREATE TABLE tags_tags ( id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY, tag varchar(64) NOT NULL UNIQUE ); CREATE TABLE tags_destinations ( id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY, url varchar(250) NOT NULL UNIQUE, urlhash varchar(32) NOT NULL UNIQUE ); CREATE TABLE tags_posts ( id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY, user_id integer NOT NULL REFERENCES auth_users (id), destination_id integer NULL REFERENCES tags_destinations (id), posted datetime NOT NULL, title varchar(250) NOT NULL, desc varchar(250) NOT NULL ); CREATE TABLE tags_posts_tags ( id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY, post_id integer NOT NULL REFERENCES tags_posts (id), tag_id integer NOT NULL REFERENCES tags_tags (id), UNIQUE (post_id, tag_id) ); INSERT INTO packages (label, name) VALUES ('tags', 'tags'); INSERT INTO content_types (name, package, python_module_name) VALUES ('tag', 'tags', 'tags'); INSERT INTO auth_permissions (name, package, codename) VALUES ('Can add tag', 'tags', 'add_tag'); INSERT INTO auth_permissions (name, package, codename) VALUES ('Can change tag', 'tags', 'change_tag'); INSERT INTO auth_permissions (name, package, codename) VALUES ('Can delete tag', 'tags', 'delete_tag'); INSERT INTO content_types (name, package, python_module_name) VALUES ('destination', 'tags', 'destinations'); INSERT INTO auth_permissions (name, package, codename) VALUES ('Can add destination', 'tags', 'add_destination'); INSERT INTO auth_permissions (name, package, codename) VALUES ('Can change destination', 'tags', 'change_destination') INSERT INTO auth_permissions (name, package, codename) VALUES ('Can delete destination', 'tags', 'delete_destination') INSERT… adrian garthk@gmail.com   0 0 0 0 0 0
356 2005-08-18 11:36:56 2006-10-08 00:04:54 2019-06-24 00:19:03.897954 Unreviewed closed Core (Other) enhancement normal   duplicate [patch]: simple XML-RPC support for Django The idea of this patch is to add support to Django for basic XML-RPC capabilities. It works mostly like URL patterns in that there is a ROOT_RPCCONF setting that points to a module that defines a rpc call registry like this: {{{ #!python rpccalls = { 'anton': 'gallery.test.anton', } }}} So the registry is a simple dictionary that maps method names (they can be structured with "." - for example blogger.post) to functions in modules (function "anton" in module gallery.test in this case). Additionally you need to add a mapping for some URL to the rpc view: {{{ #!python urlpatterns = patterns('', (r'^RPC/', 'django.core.rpc.call'), ) }}} The last part is the django.core.rpc module: {{{ #!python import sys import time import xmlrpclib from django.utils.httpwrappers import HttpResponse from django.conf import settings dispatch = {} def call(request): """ This is the view you need to map into your URL space to process RPC calls. """ p, u = xmlrpclib.getparser() p.feed(request.raw_post_data) p.close() args = u.close() method = u.getmethodname() func = dispatch.get(method, None) if func is not None: result = func(*args) xml = xmlrpclib.dumps((result,), methodresponse=1) else: xml = xmlrpclib.dumps(xmlrpclib.Fault(-32601, 'method unknown: %s' % method), methodresponse=1) return HttpResponse(xml, mimetype='text/xml; charset=utf-8') # build the dispatch table for rpc calls out of ROOT_RPCCONF for (fn, fc) in __import__(settings.ROOT_RPCCONF, '', '', ['']).rpccalls.items(): p = fc.rfind('.') modname = fc[:p] funcname = fc[p+1:] dispatch[fn] = getattr(__import__(modname, '', '', ['']), funcname) }}} After setting up all this (django.core.rpc should go into the django source - that's the actual patch), you could use your new RPC call like this: {{{ #!python impo… adrian hugo <gb@bofh.ms>   0 1 0 0 0 0
359 2005-08-18 12:22:22 2007-07-03 23:05:44 2019-06-24 00:19:05.843335 Accepted closed contrib.admin defect normal   duplicate Simplified assignment and lookup for related fields Further to #122, I'd love to see a simpler syntax for direct assignment and reference of objects in related tables. It'd eliminate the last big separation (in my mind, at least) between how people work with normal Python objects and how they need to work Django database-backed objects. All you'd have left is {{{.save()}}}, which I'm all for keeping. {{{ from django.core import meta class Person(meta.Model): name = meta.CharField(maxlength=200) class CourtCase(meta.Model): plaintiff = meta.ForeignKey(Person) defendant = meta.ForeignKey(Person) me = persons.get_object(name__exact="garthk") you = persons.get_object(name__exact="hugo-") case = courtcases.CourtCase() case.defendant = me case.plaintiff = you case.save() print case.defendant.name }}} We'd also want to retain support for {{case.defendant_id = me.id}} for those who tend to think more in terms of the database structures than the Python structures. I'm definitely in the latter category, but I know plenty of people in the former. adrian garthk@gmail.com   0 0 0 0 0 0
370 2005-08-19 06:19:57 2005-08-19 13:12:52 2019-06-24 00:19:12.748158 Unreviewed closed Core (Other) defect normal   duplicate Omitting terminal slash in form action breaks POST data due to redirect == Steps to repro == 1. Add an urlpattern to your app like so: {{{ (r'^search/$', 'search'), }}} 2. Add a search view that spits out debugging info: {{{ def search(request): return HttpResponse(linebreaks(escape(request))) }}} 3. Create a form that submits to this view: {{{ <form method="POST" action="/search"> <!-- Note missing terminal / --> }}} 4. Test the form. == Expected == Any data submitted via the form show up as key:value pairs in the request.POST. == Actual == The POST is empty, because the framework redirects the POST without the slash to the slashified URL as a GET. It should probably detect the POST and forward the dict full of useful form data. adrian mrtact@gmail.com   0 0 0 0 0 0
384 2005-08-21 13:18:08 2007-01-17 22:12:17 2019-06-24 00:19:21.811644 Unreviewed closed contrib.admin enhancement normal 1.0 duplicate A delete button next to 'many' in admin might be more intuitive As a follow up to my previous report #383, a delete button next to the inline edited items (in the tutorial, the Choices for a particular Poll) would be much cleaner and more intuitive than the 'leave the field blank to delete' approach. Build 541, OS X, Python 2.4.1, MySQL 4.1.12 adrian ssteiner delete, tutorial2, admin 0 0 0 0 0 0
419 2005-08-26 04:23:46 2006-10-22 16:30:00 2019-06-24 00:19:44.584307 Unreviewed closed Metasystem enhancement enhancement   duplicate Create meta.AbstractModel {{{ #!python class BaseModel(meta.Model): foo = meta.CharField(maxlength=200) class FirstChild(BaseModel): bar = meta.CharField(maxlength=10) class SecondChild(BaseModel): bar = meta.CharField(maxlength=10) }}} In this example, {{{BaseModel}}} only exists as an "abstract class" -- its only purpose is to be extended. We don't want to install SQL for it, and we don't want it to be available via the API. So we could introduce a {{{meta.AbstractModel}}} for models that serve this purpose. adrian adrian   0 0 0 0 0 0
422 2005-08-26 16:06:45 2005-08-26 16:53:16 2019-06-24 00:19:46.535972 Unreviewed closed Core (Other) enhancement trivial   duplicate define a default charset for web pages On django/utils/httpwrappers.py the DEFAULT_MIME_TYPE is just "text/html". That means the web browsers sometimes show "weird things" when one uses non-ascii characters on the templates (example: customize base_site.html adding some utf-8 characters and open the http://.../admin/ login page). It would be better to define a default charset, changing that to DEFAULT_MIME_TYPE = 'text/html; charset=utf-8' (the same mimetype used on the admin interface). adrian anonymous   0 0 0 0 0 0
427 2005-08-26 17:51:19 2005-08-26 17:53:08 2019-06-24 00:19:49.796194 Unreviewed closed *.djangoproject.com defect normal   duplicate trac problem Trying to list all tickets to complete milestone 1: ParseError: [/home/html/templates/djangoproject.com/trac_templates//query.cs:24] Undefined macro called: hdf_select_multiple(query.options.component, 'component', 4) jacob santagada@gmail.com trac 0 0 0 0 0 0
433 2005-08-29 20:14:37 2005-09-02 18:47:25 2019-06-24 00:19:53.628335 Unreviewed closed Metasystem enhancement normal   duplicate Add ability to delete multiple objects in a single call There is a way to retrieve multiple objects using get_list function. There should be also a way to delete multiple objects on a single call. For example {{{ polls.delete(total_votes__lt=10) }}} adrian samuel   0 0 0 0 0 0
437 2005-08-30 10:25:00 2006-10-07 22:05:36 2019-06-24 00:19:56.198298 Unreviewed closed Core (Cache system) enhancement normal   duplicate [patch] In memory file cache Attached to this ticket is a implementation of in memory based file cache. I got basic idea from vampire TemplateCache and re-implemented it to make more general. Usage is simple, if you want to cache a file just call {{{ cache = get_cache('<cache name>') }}} and then {{{ file_contents = cache.load('filename') }}}. It will detect if the file is modified since last access and reload file. I'm currently using it for caching translation objects for Ticket #65. jacob nesh <nesh [at] studioquattro [dot] co [dot] yu>   0 1 0 0 0 0
442 2005-08-30 21:52:05 2007-07-03 23:06:12 2019-06-24 00:19:59.348195 Design decision needed closed contrib.admin   normal   duplicate Admin interface throws errors that aren't displayed The administrative interface will warn of an error when saving an object, but will not display an explanation for that error. See included screenshot. adrian Alex Payne <al3x@al3x.net>   0 0 0 0 0 0
463 2005-09-06 06:37:45 2007-01-17 22:12:17 2019-06-24 00:20:12.597866 Unreviewed closed Core (Other) defect major   duplicate [patch] new mysql.DatabaseWrapper - solving multiple MySQL problems This patch solves a problem of multiple errors while hosting Django app with FastCGI and MySQL. I was running it for 24 hours without any problems. Some highlights: 1) Django uses the same connection for all threads. It breaks MySQL leading to numerous random CR_SERVER_GONE_ERROR and CR_SERVER_LOST errors. Every independently talking entity should have its own connection. I've implemented mysql.!DatabaseWrapper using dictionary to keep one connection per thread. 2) During request for new connection, old connections are examined. If thread is gone, its connection is closed and garbage-collected. 3) MySQL connection can time-out depending on MySQL server settings. The standard practice is to ping() stored connections before use. My implementation does it for every retrieved connection. Some potential problems: 1) I rename threads, which request connections, to make them unique. If some other code relies on thread names, it may be broken. 2) 24 hour testing is not enough for production quality code. Changes are very small and compact. They can be verified manually. But still it is not a full blown system test under different hosting scenarios. 3) Please take a look at the code and verify that it is optimal --- my python experience is limited, I could implement something in sub-optimal way. The patch: {{{ Index: mysql.py =================================================================== --- mysql.py (revision 629) +++ mysql.py (working copy) @@ -11,6 +11,9 @@ from MySQLdb.constants import FIELD_TYPE import types +import thread, threading +from sets import Set + DatabaseError = Database.DatabaseError django_conversions = conversions.copy() @@ -23,32 +26,78 @@ class DatabaseWrapper: def __init__(self): - self.connection = None + self.connections = {} + self.threads = Set() + self.lock = thread.allocate_lock() self.queries = [] + + def _get_connection(self): + self.lock.acquire() + try:… adrian eugene@lazutkin.com   0 1 0 0 0 0
483 2005-09-10 01:52:05 2005-09-10 04:15:25 2019-06-24 00:20:25.279207 Unreviewed closed contrib.admin defect normal   duplicate Possibility to remove child records when doing the inline editing It should be possible to remove child records when doing the inline editing using {{{ForeignKey}}} adrian brovienas@yahoo.com   0 0 0 0 0 0
513 2005-09-14 19:02:25 2006-06-12 11:10:12 2019-06-24 00:20:44.291406 Unreviewed closed Core (Other) defect normal   duplicate an integer form field is passed to sql as a string if it is None and not on the form. If you have an IntegerField and you don't define it within the HTML form, when it is submitted and ChangeManipulator.save is called (I assume AddManipulator is the same here), and if the value is None, then it is submitted to the sql execute as a string and the sql writes it out as a string (i.e. some_number = '', ...). adrian anonymous   0 0 0 0 0 0
526 2005-09-19 12:12:00 2007-08-31 03:42:09 2019-06-24 00:20:52.724185 Accepted closed Database layer (models, ORM) defect major master duplicate Error when edit_inline model have unique_together constraint Example: {{{ #!python class Locale(meta.Model): """ available languages """ locale = meta.CharField(maxlength=5, unique=True) encoding = meta.CharField(maxlength=50, choices=ENCODINGS, default='utf_8') name = meta.CharField(maxlength=200, unique=True) plural = meta.TextField('plural form', help_text='plural form expression, see: <a href="http://www.gnu.org/software/gettext/manual/html_node/gettext_150.html" target="_blank">gettext</a>', blank=True, null=True) nplurals = meta.PositiveSmallIntegerField('number of plural forms', blank=True, null=True) def __repr__(self): return self.name # def _manipulator_validate_plural(self, field_data, all_data): """ validate plurals """ field_data = field_data.strip() if field_data == '': return '' if all_data['nplurals'].strip() == '': from django.core import validators raise validators.ValidationError('No nplurals is defined!') # try to compile plural expression try: from gettext import c2py c2py(field_data) except ValueError, err: from django.core import validators raise validators.ValidationError('Plural form expression error %s' % err) # _manipulator_validate_plural class META: ordering = ['locale'] admin = meta.Admin( fields = ( (None, { 'fields': ('locale', 'encoding', 'name',),}), ('Plurals', { 'fields': ('nplurals', 'plural'),}), ), list_display = ('name', 'locale', 'encoding'), ) # META # Locale class Message(meta.Model): """ messages """ site = meta.ForeignKey(sites.Site, null=True) package = meta.ForeignKey(packages.Package, null=True) message = meta.CharField(maxlength=255) has_plural = meta.BooleanField(default=False) … adrian nesh <nesh [at] studioquattro [dot] co [dot] yu>   0 0 0 0 0 0
545 2005-09-23 09:10:33 2005-09-23 12:35:07 2019-06-24 00:21:05.798845 Unreviewed closed Core (Other) defect critical   duplicate Checkin [670] breaks modpython Due to a chain of imports, the environment never gets updated in modpython after [671] Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 287, in HandlerDispatch log=debug) File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 457, in import_module module = imp.load_module(mname, f, p, d) File "/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py", line 1, in ? from django.core.handlers.base import BaseHandler File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 1, in ? from django.utils import httpwrappers File "/usr/lib/python2.3/site-packages/django/utils/httpwrappers.py", line 5, in ? from django.conf.settings import DEFAULT_MIME_TYPE File "/usr/lib/python2.3/site-packages/django/conf/settings.py", line 29, in ? raise EnvironmentError, "Environment variable %s is undefined." % (ENVIRONMENT_VARIABLE) EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined. adrian robert@wittams.com   0 0 0 0 0 0
547 2005-09-23 12:00:22 2007-02-01 21:06:49 2019-06-24 00:21:07.223308 Unreviewed closed Tools enhancement normal   duplicate [patch] XMLRPC support for django I have a working XMLRPC implementation for django. Here is how to use it: Add the following to urlpatterns: {{{ #!python urlpatterns = patterns('', (r'^xmlrpc/', 'myproject.apps.xrpc.views.xrpc.serve'), ) }}} I have borrowed code heavily from [http://www.python.org/doc/2.4/lib/simple-xmlrpc-servers.html SimpleXMLRPCServer], which comes with standard python distribution, so we have the same API as described in its documentation, other than the constructor. I have added some security enhancement, so every published method must contain a public attribute which must be set to True before we would serve it. Here is an example xrpc.py: {{{ #!python from django.contrib.xmlrpc import SimpleXMLRPCView class c: def f(self): return "public func, will be served." f.public = True def g(self): return "private, wont be served." serve = SimpleXMLRPCView() serve.register_instance(c()) }}} Finally an example of how to use it: {{{ #!python >>> import xmlrpclib >>> server = xmlrpclib.Server('http://localhost:8000/xrpc/') >>> server.f() 'public func, will be served.' >>> server.g() Traceback (most recent call last): File "<interactive input>", line 1, in ? File "C:\Python24\lib\xmlrpclib.py", line 1096, in __call__ return self.__send(self.__name, args) File "C:\Python24\lib\xmlrpclib.py", line 1383, in __request verbose=self.__verbose File "C:\Python24\lib\xmlrpclib.py", line 1137, in request headers ProtocolError: <ProtocolError for localhost:8000/xrpc/: 500 INTERNAL SERVER ERROR> >>> }}} Will attach the patch shortly. adrian upadhyay@gmail.com   0 1 0 0 0 0
552 2005-09-24 12:18:30 2009-06-17 10:39:32 2019-06-24 00:21:10.531642 Unreviewed closed Tools defect normal   duplicate [patch] SOAP support for django In line with [http://code.djangoproject.com/ticket/547 XMLRPC support for django] I have a work in progress for SOAP support, semantics is very much similer to what is described there, the service is a view, you map the view in urlconf, and use a callable instance SimpleSOAPView. Register methods/instances to be served by using the SOAPpy's Server API. Eg: {{{ #!python from django.contrib.soap import SimpleSOAPView soap = SimpleSOAPView() def f2(): return 'f2' soap.registerFunction(f2) }}} This has a dependency requirement of SOAPpy. One thing to note is the API's for SimpleXMLRPCView and SimpleSOAPView are not compatible, function names are different, one support unregistering while other does not etc; one of the reasons is that serves as a reminder that XMLRPC and SOAP are actually different, SOAP is much more configurable, supports authentication etc, which I have not used myself so have little idea, but they are different, and anyone knowing SOAPpy or xmlrpc will not have to learn anything new while using them over django. Practicality beats purity? adrian upadhyay@gmail.com   0 1 0 0 0 0
561 2005-09-26 16:08:47 2005-09-26 16:20:14 2019-06-24 00:21:16.160114 Unreviewed closed Metasystem enhancement normal   duplicate Relate Objects to a choice of objects I have a object that needs to be related to one of a number objects. I propose two new field types called ForeignChoice and ManyToManyChoice (name suggestions welcomed, because I think they suck to be honest) Proposed syntax: {{{ from django.core import meta COMPONENT_TYPES = ( TextInput, ColourChoice ) class Component(meta.Model): name = meta.CharField(max_length=32) input = meta.ForeignChoice(COMPONENT_TYPES) class TextInput(meta.Model): text = meta.TextField() class ColourChoice(meta.Model): name = meta.SlugField(primary_key=True) rgb = meta.CharField(max_length=7) }}} This would create a appname_components table with the id and name fields as you'd expect, but also input_class and input_id fields. input_class would be one of 'TextInput' or 'ColourChoice', and input_id would refer to the PK in that class. I'll start work on a patch soon, but ideas and comments would be very welcome adrian Boffbowsh   0 0 0 0 0 0
570 2005-09-27 21:25:18 2005-09-29 02:53:38 2019-06-24 00:21:21.700664 Unreviewed closed Core (Other) defect normal   duplicate formfields.SelectField doesn't select correct value for ForeignKey formfields.SelectField renders withou "selected" attribute set to the correct option. This happens because FormWrapper fetches 'data' for SelectField.render() by its field_name. However most of the times real data for the field is stored in form's dict under field_name+'_id' key. This effectively breaks every form with the ForeignKey generated by generic view 'update_object' or with Manipulators as described in docs at http://www.djangoproject.com/documentation/forms/ Patch follows... adrian Maniac <Maniac@SoftwareManiacs.Org>   0 0 0 0 0 0
584 2005-10-02 16:48:10 2007-01-17 22:12:17 2019-06-24 00:21:30.543496 Unreviewed closed Metasystem defect major   duplicate [patch] fix many-to-many with non-default pks. I found that many to many fields do not work when the primary keys of the objects are not default. As I'm working in the new-admin branch and this is an obvious fix, I thought I'd point it up here so it can be applied to trunk. {{{ def method_set_related_many_to_many(rel_opts, rel_field, self, id_list): id_list = map(int, id_list) # normalize to integers rel = rel_field.rel.to m2m_table = rel_field.get_m2m_db_table(rel_opts) this_id = getattr(self, self._meta.pk.column) cursor = db.db.cursor() delete_stmt = "DELETE FROM %s WHERE %s = %%s" % (m2m_table, rel.pk.column) cursor.execute(delete_stmt, [this_id]) insert_stmt = "INSERT INTO %s (%s, %s) VALUES (%%s, %%s)" % (m2m_table, rel.pk.column, rel_opts.pk.column) cursor.executemany(insert_stmt, [(this_id, i) for i in id_list]) db.db.commit() }}} adrian rjwittams   0 1 0 0 0 0
608 2005-10-10 22:20:49 2006-10-22 15:55:25 2019-06-24 00:21:45.554836 Unreviewed closed Generic views enhancement normal   duplicate Allow objects with future dates to display in date based generic views The date based generic views are coded to only show objects whose given date field is <= now. However, for views of something like an events calendar, one needs to display objects whose date field is >= now. Proposed is to add an "upcoming_index", which sorts ascending, for showing future objects, and a "future_ok=False" keyword argument to the "archive_(year, month,day)" and "object_detail" views. jacob scaba   0 0 0 0 0 0
619 2005-10-13 06:37:20 2008-05-17 19:05:12 2019-06-24 00:21:52.439084 Unreviewed closed *.djangoproject.com defect normal   duplicate documentation page should point to new IRC log The [http://www.djangoproject.com/documentation/ documentatin page] still points to the loglibrary IRC logs that aren't updated. It should be changed to the [http://simon.bofh.ms/logger/django/ new IRC log]. jacob hugo   0 0 0 0 0 0
623 2005-10-13 21:23:14 2005-10-13 23:32:30 2019-06-24 00:21:54.948773 Unreviewed closed Template system enhancement normal   duplicate [patch] Allow ssi tag to use template dirs, making apps that use this feature much more portable The current ssi template tag requires that files be specified using absolute paths. This makes apps much harder to redistribute, and limits the usefulness of this tag. Since a major use of this tag would be to factor out common code in templates, it makes sense to put these includes in template directories, and to allow the tag to search the TEMPLATE_DIRS for files to include. The patch attached implements this, keeping compatibility with existing code by only looking for a template file if the path specified is relative rather than absolute. This kind of overlaps with ticket #598, but this one could be added with no side effects for anyone else. adrian L.Plant.98@cantab.net   0 1 0 0 0 0
637 2005-10-17 18:16:30 2005-10-17 18:32:41 2019-06-24 00:22:03.834841 Unreviewed closed contrib.admin defect normal   duplicate Errors in tests - sqlite v. 911 - Python 2.4.2 - sqlite-3.2.1 - pysqlite-2.0.4 ---- {{{ Running tests with database 'sqlite3' 'one_to_one' module: API test raised an exception ================================================= Code: "w = r.add_waiter(name='Joe')" Line: 40 Exception: File "/home/bless/django/django_src/tests/doctest.py", line 1243, in __r un compileflags, 1) in test.globs File "<doctest one_to_one[13]>", line 1, in ? w = r.add_waiter(name='Joe') File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line 3, in _cur ried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/usr/lib/python2.4/site-packages/django/core/meta/__init__.py", line 950, in method_add_related obj = rel_mod.Klass(**init_kwargs) File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line 3, in _cur ried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/usr/lib/python2.4/site-packages/django/core/meta/__init__.py", line 762, in method_init raise TypeError, "Invalid value: %r should be a %s instance, not a %s" % (f.name, f.rel.to, type(rel_obj)) TypeError: Invalid value: 'restaurant' should be a <Options for restaurants> instance , not a <class 'django.models.one_to_one.Restaurant'> 'one_to_one' module: API test raised an exception ================================================= Code: 'w.save()' Line: 41 Exception: File "/home/bless/django/django_src/tests/doctest.py", line 1243, in __r un compileflags, 1) in test.globs File "<doctest one_to_one[14]>", line 1, in ? w.save() NameError: name 'w' is not defined 'one_to_one' module: API test raised an exception ================================================= Code: 'w' Line: 42 Exception: File "/home/bless/django/django_src/tests/doctest.py", line 1243, in __r un compileflags, 1) in test.globs File "<doctest one_to_one[15]>", line 1, in ? w NameError: name 'w' is not defined 3 erro… adrian Bless   0 0 0 0 0 0
644 2005-10-18 18:12:54 2006-10-22 15:55:52 2019-06-24 00:22:08.259543 Unreviewed closed Database layer (models, ORM) defect normal   duplicate SQL Server DB backend: Rev 940 test results This is the output of tests/runtests.py against MS SQL 2000 SP 3 on Win2K SP4. adrian jdunck@gmail.com db ado sqlserver core test 0 0 0 0 0 0
651 2005-10-19 20:42:10 2008-07-29 18:58:58 2019-06-24 00:22:12.709255 Design decision needed closed Core (Other) enhancement normal   duplicate Allow directories in filename argument to save_<fieldname>_file Currently, all files associated with !FileFields are uploaded into a single directory specified by MEDIA_ROOT and upload_to. There is no way to specify directories on a per-file basis when files are uploaded. With this patch, if the filename argument to save_<fieldname>_file specifies a directory as well as a filename, the file will be uploaded to that directory under the MEDIA_ROOT/upload_to directory. Example: {{{ #!python class File(meta.Model): file = meta.FileField(upload_to='baseDir') name = meta.CharField(maxlength=100) }}} {{{ #!python newFile = files.File(name='my file') newFile.save_file_file('some/sub/directory/myFile.txt', 'Some text content') }}} The above lines will create a file at: <MEDIA_ROOT>/baseDir/some/sub/directory/myFile.txt. This shouldn't change how most file uploading (including the admin app) works now, because normally just a filename without any directories is passed to save_<fieldname>_file. However, it allows custom view code or !FileField subclasses (each of which will call save_<fieldname>_file) to save files to specific locations easily. PhiR Adam Endicott <leftwing17@gmail.com> fs-rf-fixed 0 0 0 0 0 0
690 2005-10-25 01:18:34 2007-07-17 21:56:24 2019-06-24 00:22:37.431865 Accepted closed contrib.admin defect normal   duplicate Model allowed me to 'hide' a required field, which produced unuseable error messages. I had a data model which had a required field 'text'. When I was ordering the fields using the following syntax: admin = meta.Admin( # Add this to order the fields and even group them! fields = ( (None, {'fields': ('title', 'published_date')} ), ("Categories", {'fields': ('categories',)} ), ) ) I forgot to put in the 'text' field. Which meant that when I was adding a new item, it would complain that I should fix the 'error' below, but there was no error listed below, because the text field was never shown. The validate command should catch this maybe? But at the very least, if error messages aren't shown during the display of the form, they should be shown in a final list at the end. Or something. adrian lakin.wecker@gmail.com   0 0 0 0 0 0
691 2005-10-25 01:19:10 2005-10-25 01:19:55 2019-06-24 00:22:38.075881 Unreviewed closed contrib.admin defect normal   duplicate Model allowed me to 'hide' a required field, which produced unuseable error messages. I had a data model which had a required field 'text'. When I was ordering the fields using the following syntax: admin = meta.Admin( # Add this to order the fields and even group them! fields = ( (None, {'fields': ('title', 'published_date')} ), ("Categories", {'fields': ('categories',)} ), ) ) I forgot to put in the 'text' field. Which meant that when I was adding a new item, it would complain that I should fix the 'error' below, but there was no error listed below, because the text field was never shown. The validate command should catch this maybe? But at the very least, if error messages aren't shown during the display of the form, they should be shown in a final list at the end. Or something. adrian lakin.wecker@gmail.com   0 0 0 0 0 0
695 2005-10-25 16:31:22 2006-10-07 13:50:06 2019-06-24 00:22:40.632777 Unreviewed closed Database layer (models, ORM) defect blocker 0.91 duplicate sqlupdate, creates sql to update the database based on an updated model file I've created a function for django-admin.py that dumps the sql that will transition an old database model (the one that is in the database currently) to a new one based an updated django model. So if you change the name of a model, or add a column, or delete a column, etc. it will output the sql to alter the database for you. And I think it's a shame that no one else has this, as it is remarkably usefull. For instance, if I have this originally: {{{ class Poll(meta.Model): question = meta.CharField(maxlength=128) responses = meta.IntegerField(default=0) }}} And I want to go to this: {{{ class Poll(meta.Model): question = meta.CharField(maxlength=128) title = meta.CharField(maxlength=128) }}} It will create the sql to drop "responses" and add "title". There are two steps in doing this. The first is to create a "transition" file. This file allows you to tweak the changes that the code thinks should be done. For instance, if you change Poll a lot, and then changed the name to Survey or something, it might think you dropped Poll and created a table called Survey. So it would create in the file: {{{ Drop("Poll") Add("Survey") }}} But you might want to change it to: {{{ Name("app_polls", "Survey") Change("Survey") }}} Which tells it that the table that was named polls, should be called "Survey" now, and also it should make all the changes to "Survey". This all goes in a file right next to your model file. If your model file was called "model.py", the transition file would be called "model.transition.py" The next step is to actually run the sqlupdate, that will analyze the transition file, and spew out the SQL to realize those changes. To perform the complete steps: 1. django-admin.py transition <app_name> 2. <check the transition file to make sure it's kosher> 3. django-admin.py sqlupdate <app_name> # which won't commit the changes 4. django-admin.py sqlupdate <app_name> | mysql -p <project_name> # which will commit the changes (in mysql) … adrian brantley (deadwisdom@gmail.com)   0 0 0 0 0 0
698 2005-10-26 15:52:14 2006-10-22 16:41:26 2019-06-24 00:22:42.579810 Unreviewed closed Core (Management commands) defect normal   duplicate Exceptions thrown after CONTROL-C typed to stop test web server. I received the following exceptions after attempting to stop the built-in test server with CONTROL-C: {{{ shell> django-admin.py runserver Validating models... 0 errors found. Starting server on port 8000 with settings module 'myproject.settings'. Go to http://127.0.0.1:8000/ for Django. Quit the server with CONTROL-C (Unix) or CTRL-BREAK (Windows). [26/Oct/2005 09:43:53] "GET /admin/ HTTP/1.1" 200 1615 [26/Oct/2005 09:44:00] "POST /admin/ HTTP/1.1" 302 0 [26/Oct/2005 09:44:00] "GET /admin/ HTTP/1.1" 200 5899 Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/local/python-2.4.1/lib/python2.4/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/usr/local/python-2.4.1/lib/python2.4/threading.py", line 636, in __exitfunc self._Thread__delete() File "/usr/local/python-2.4.1/lib/python2.4/threading.py", line 522, in __delete del _active[_get_ident()] KeyError: 1076103392 Error in sys.exitfunc: Traceback (most recent call last): File "/usr/local/python-2.4.1/lib/python2.4/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/usr/local/python-2.4.1/lib/python2.4/threading.py", line 636, in __exitfunc self._Thread__delete() File "/usr/local/python-2.4.1/lib/python2.4/threading.py", line 522, in __delete del _active[_get_ident()] KeyError: 1076103392 }}} adrian Tekhne   0 0 0 0 0 0
705 2005-10-29 00:27:29 2005-11-27 12:38:59 2019-06-24 00:22:47.047638 Unreviewed closed Template system enhancement normal   duplicate Patch to allow ssi tag to try templates first, then absolute url This patch allows ssi tag to search templates first, then search for the absolute path. This works for i18n branch. Inline bellow. {{{ Index: django/core/template/defaulttags.py =================================================================== --- django/core/template/defaulttags.py (revisão 1015) +++ django/core/template/defaulttags.py (cópia de trabalho) @@ -1,6 +1,6 @@ "Default tags used by the template system, available to all templates." -from django.core.template import Node, NodeList, Template, Context, resolve_variable, resolve_variable_with_filters, get_filters_from_token, registered_filters +from django.core.template import Node, NodeList, Template, Context, resolve_variable, resolve_variable_with_filters, get_filters_from_token, registered_filters, TemplateDoesNotExist from django.core.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, register_tag from django.utils import translation @@ -214,6 +214,12 @@ self.filepath, self.parsed = filepath, parsed def render(self, context): + try: + from django.core.template import loader + t = loader.get_template(self.filepath) + return t.render(context) + except TemplateDoesNotExist: + pass if not include_is_allowed(self.filepath): return '' # Fail silently for invalid includes. try: }}} adrian jpaulofarias@gmail.com tag, ssi, template 0 0 0 0 0 0
711 2005-11-01 00:27:45 2006-10-07 12:59:31 2019-06-24 00:22:50.908185 Unreviewed closed contrib.admin defect normal   duplicate ManyToManyField doesn't support "self" instead of a class name parameter. The !ManyToManyField type doesn't support using "self" as an alternative to the class name as with !ForeignKeys. adrian cygnus@cprogrammer.org   0 0 0 0 0 0
712 2005-11-01 01:55:46 2007-07-03 23:08:07 2019-06-24 00:22:51.518686 Design decision needed closed Database layer (models, ORM) defect blocker   duplicate trunk django/core/meta/__init__.py in method_save(opts, self) raises exceptions.AttributeError (osx, mysql4, python24) '''Interactive Session''' (ipython) {{{ #!python In [1]: from django.models.recipes import ingredients In [2]: ingredients.get_count() Out[2]: 0L In [3]: ingredients.Ingredient?? Type: ModelBase Base Class: <class 'django.core.meta.ModelBase'> String Form: <class 'django.models.recipes.Ingredient'> Namespace: Interactive File: /Users/levi/Projects/twistedrails.org/trunk/django/barmate/apps/recipes/models/recipes.py Source: class Ingredient (meta.Model): name = meta.CharField(maxlength=30) description = meta.TextField() parent_type = meta.ForeignKey('self') def __repr__(self): return '%s' % self.name In [4]: i = ingredients.Ingredient() In [5]: hasattr(i, 'id') Out[5]: False In [6]: hasattr(i, 'save') Out[6]: True In [7]: i.name = 'Milk' In [7]: i.save() --------------------------------------------------------------------------- exceptions.AttributeError Traceback (most recent call last) /Users/levi/Projects/twistedrails.org/trunk/django/<console> /Users/levi/Projects/3rdParty/django_src/django/utils/functional.py in _curried(*moreargs, **morekwargs) 1 def curry(*args, **kwargs): 2 def _curried(*moreargs, **morekwargs): ----> 3 return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) 4 return _curried /Users/levi/Projects/3rdParty/django_src/django/core/meta/__init__.py in method_save(opts, self) 781 782 # First, try an UPDATE. If that doesn't update anything, do an INSERT. --> 783 pk_val = getattr(self, opts.pk.column) 784 pk_set = bool(pk_val) 785 record_exists = True AttributeError: 'Ingredient' object has no attribute 'id' }}} '''svn info''' {{{ levi@id ~/Projects/3rdParty/django_src $ svn info Path: . URL: http://code.djangoproject.com/svn/django/trunk Repository UUID: bcc190cf-cafb-0310-a4f2-bffc1f526a37 Revision: 1032 Node Kind: directory Schedule: normal La… adrian levicook@gmail.com   0 0 0 0 0 0
713 2005-11-01 16:37:09 2006-10-07 13:31:52 2019-06-24 00:22:52.156635 Unreviewed closed Core (Other) defect normal   duplicate sqlreset expects django admin to be installed When no django admin is installed in a project, sqlreset will still produce the deletes on the django admin log. Maybe it should check wether django.contrib.admin is in the installed apps and only output django admin log statements when the django admin is in there? adrian hugo   0 0 0 0 0 0
714 2005-11-02 00:50:40 2010-04-06 00:45:36 2019-06-24 00:22:52.795890 Unreviewed closed contrib.admin enhancement normal master duplicate access to id of current user on admin The model code of admin application doesn't have access to the request, so if I want to save the id of user that is creating the poll, I can't access to it. this may be more clear, something like this should work: from django.core import meta from django.models.auth import User # Create your models here. class Poll(meta.Model): question = meta.CharField(maxlength=200) pub_date = meta.DateTimeField('date published') author = meta.ForeignKey(User, default=User.id) class META: admin = meta.Admin() adrian flavio.curella@gmail.com   0 0 0 0 0 0
749 2005-11-07 13:18:12 2011-09-28 16:12:16 2019-06-24 00:23:15.040970 Design decision needed closed Core (Other) defect normal   duplicate Middleware should work as a 'stack' or allow custom orderings This ticket is the summary/result of a discussion on django-developers, especially near the end of this thread: http://groups.google.com/group/django-developers/browse_thread/thread/2865c3f1e8780bf6/999616351a520e67?lnk=arm#999616351a520e67 The current behaviour of a set of middleware is that they are used in the order in which they are listed for process_request and process_view, and in reverse order for process_exception and process_response. If one middleware returns an HttpResponse in process_request, then the remaining ones in the list are skipped as far as process_request is concerned, but they all still contribute to process_response. Instead, they should be skipped. The current behaviour makes the CacheMiddleware buggy. Consider this stack {{{ MIDDLEWARE_CLASSES = ( "django.middleware.cache.CacheMiddleware", "somemodule.SomePostProcessingMiddleware", "django.middleware.session.SessionMiddleware", ) }}} The first time a page is accessed, it will go through all middleware both 'down' (process_request) and 'up' (process_response), and the page is cached ''after'' it has been post-processed by SomePostProcessingMiddleware. The second time we have a cache hit, and the CacheMiddleware returns the response. However, that response still goes through all the process_response middleware, so SomePostProcessingMiddleware is applied twice, which is bad. In theory this could be bad for any of the middleware (adding headers twice etc), it just depends what they do. If CacheMiddleware returns a response, the ones beneath it should be skipped for process_response. There are alternative fixes, including: 1) allow different ordering for request and response middleware to specified 2) change the CacheMiddleware so that it creates a deep copy of the cached response, attaches it to the request object, and then in process_response ignores the passed in response object, and returns the one it stashed earlier. 3) split CacheMiddleware into two, to allow different ordering I think… nobody L.Plant.98@cantab.net   0 0 0 0 0 0
785 2005-11-14 03:47:53 2007-12-02 01:21:14 2019-06-24 00:23:37.919270 Accepted closed Database layer (models, ORM) enhancement normal master duplicate many2many table and legacy databases. hi. I have the following table in a legacy database. {{{ CREATE TABLE `hostgroup_membership` ( `hostid` int(11) NOT NULL default '0', `groupid` int(11) NOT NULL default '0', KEY `hostid` (`hostid`), KEY `groupid` (`groupid`), CONSTRAINT `hostgroup_membership_ibfk_1` FOREIGN KEY (`hostid`) REFERENCES `host` (`id`) ON DELETE CA SCADE, CONSTRAINT `hostgroup_membership_ibfk_2` FOREIGN KEY (`groupid`) REFERENCES `hostgroup` (`id`) ON DEL ETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Hostgroup membership'; }}} and i would like to use a many2many field in my model to represent this. right now I have 2 limitations. 1. I can not specify the table name. 2. I can not specify the field names and what they map too. what I would like to be able to do is somehow specify the tablename, as well as how the fields map to their respective column names. something like {{{ class Host(meta.model): Groups = meta.manyTomanyfield(Groups, db_table='foo', columns={self_col:'hostid', to_col:'groupid' }) }}} and have the manytomany code do the right thing. nobody Ian@holsman.net   0 1 1 0 0 0
789 2005-11-14 14:11:04 2005-11-14 15:29:26 2019-06-24 00:23:40.471005 Unreviewed closed Translations enhancement normal   duplicate update Slovak (sk) translation   hugo vlado@labath.org   0 0 0 0 0 0
802 2005-11-15 15:01:05 2006-06-20 02:00:56 2019-06-24 00:23:48.688095 Unreviewed closed Tools defect normal   duplicate add a spam-filter callback facility to comments The comment system currently doesn't provide any way to make use of the is_public and approved flags - but I think they could be used for good. For example an approved comment could be shown with active links, while an unapproved one would be shown without active links. And a is_public=False one wouldn't be shown at all. This could be managed manually by the admin in the Django admin interface, but I think that's cumbersome for sites with heavy comment traffic (or with a heavy comment-spam problem!). So I think there should be something like {{{ COMMENT_SPAM_FILTERS = ( 'django.contrib.spamfilters.count_links', ) }}} in the settings that would allow users to hook up several filters that are run on free comments before they hit the database. The sample one would just use the number of links in the comment to decide wether it might be spam or not. There could be others that do other checks on comment data and request data. Those filters would need to get the request object passed in, so they can look at headers (as those are often a giveaway on spammers). Sure, an alternative would be to switch to a registered comment system, but not everybody likes that. Free comments are a nice and uncomplicated way, but we already know for sure that free comments will sooner or later be hit by comment spam, so we should at least provide the infrastructure to hook up spam filters. adrian hugo   0 0 0 0 0 0
817 2005-11-16 15:44:24 2006-10-22 15:53:19 2019-06-24 00:23:58.481304 Unreviewed closed Metasystem defect normal   duplicate problem with column-quoting and "computed columns" When using the registered comments, an SQL is build that produces the following error: ProgrammingError at /forum/technik/waschmaschinen/miele-superfix/discussion/ ERROR: column "SELECT COUNT(*) FROM comments_karma WHERE comments_karma.commen" does not exist SELECT "comments"."id","comments"."user_id","comments"."content_type_id","comments"."object_id","comments"."headline","comments"."comment","comments"."rating1","comments"."rating2","comments"."rating3","comments"."rating4","comments"."rating5","comments"."rating6","comments"."rating7","comments"."rating8","comments"."valid_rating","comments"."submit_date","comments"."is_public","comments"."ip_address","comments"."is_removed","comments"."site_id","auth_users"."id","auth_users"."username","auth_users"."first_name","auth_users"."last_name","auth_users"."email","auth_users"."password_md5","auth_users"."is_staff","auth_users"."is_active","auth_users"."is_superuser","auth_users"."last_login","auth_users"."date_joined","content_types"."id","content_types"."name","content_types"."package","content_types"."python_module_name","packages"."label","packages"."name","sites"."id","sites"."domain","sites"."name",("SELECT COUNT(*) FROM comments_karma WHERE comments_karma.comment_id=comments.id AND score=1") AS "_karma_total_good",("SELECT COUNT(*) FROM comments_karma WHERE comments_karma.comment_id=comments.id AND score=-1") AS "_karma_total_bad" FROM "comments","content_types" "t1","content_types" "t5","auth_users","content_types","packages","sites" WHERE "comments"."content_type_id" = "t1"."id" AND "comments"."content_type_id" = "t5"."id" AND "t1"."package" = 'forum' AND "comments"."site_id" = 1 AND "comments"."object_id" = 3 AND "t5"."python_module_name" = 'groups' AND "comments"."user_id" = "auth_users"."id" AND "comments"."content_type_id" = "content_types"."id" AND "content_types"."package" = "packages"."label" AND "comments"."site_id" = "sites"."id" ORDER BY "comments"."submit_date" ASC This looks like there is column-quoting even done on computed columns like … adrian hugo   0 0 0 0 0 0
820 2005-11-16 23:46:59 2018-06-06 14:07:35 2019-06-24 00:24:00.389837 Design decision needed closed contrib.admin New feature normal master duplicate Add "view" permission to compliment add/change/delete This small patch adds a "view" permission to compliment the add/change/delete permissions. A user with this permission will be able to see the admin display_list for an object (django.contrib.admin.views.main.change_list). It doesn't implement a view_stage(). It would be less trivial to add a sort of read-only version of change_stage/add_stage. One use case for this feature would be letting users see a list of objects even though they couldn't change them. Another would be letting a user who has add permission (but not change or delete) to see that their object got added. adrian kayos@genetikayos.com   0 1 0 0 0 0
829 2005-11-17 14:47:44 2006-10-22 16:25:14 2019-06-24 00:24:06.100512 Unreviewed closed contrib.admin defect normal   duplicate __repr__ overloaded for short_descriptions in admin interface The admin interface abuses __repr__ to get its short_descriptions for listing objects. Instead, it should have a new function (perhaps short_description or something like that) to generate these things. Then, perhaps by default, __repr__ can be '<'+classname+': '+short_description+'>' which is much more appropriate for the REPL situations in which __repr__ is traditionally used. If you have to use a special function, perhaps it could be __str__. adrian aaronsw   0 0 0 0 0 0
877 2005-11-22 14:32:48 2006-04-21 15:46:07 2019-06-24 00:24:36.922231 Unreviewed closed contrib.admin defect normal master duplicate ordering by primary key in admin with oneToOne relations is done over the wrong table If I use the admin application to browse for a relation that shares the primary key with another via an OneToOne fields, I take an error. In my example, Person shares the primary key with Party, and browsing Person I take: OperationalError at /admin/parties/persons/ (1109, "Unknown table 'parties_parties' in order clause") It seems that the Sql related is select ['`parties_persons`.`party_id`',..., '`parties_persons`.`last_modified`'] sql ' FROM `parties_persons` ORDER BY `parties_parties`.`id` DESC' and I can see that the order by is done on the "father" table. Of course, if I force a different order field with ordering = ['-dob'], for example, it's all o.k. adrian anonymous   0 0 0 0 0 0
883 2005-11-23 11:45:12 2007-01-17 22:12:17 2019-06-24 00:24:40.776424 Unreviewed closed Template system defect major master duplicate Problems with international date handling The code: {{{ {% load i18n %} {% blocktrans with object.pub_date|date:_("DATETIME_FORMAT") as date %}Published on {{ date }}{% endblocktrans %} }}} Spits out: {{{ AttributeError at /category/xml/ 'str' object has no attribute 'day' Request Method: GET Request URL: http://localhost/category/xml/ Exception Type: AttributeError Exception Value: 'str' object has no attribute 'day' Exception Location: C:\Dev\Python24\lib\site-packages\django\utils\dateformat.py in d, line 114 }}} Trace snip: {{{ ... C:\Dev\Python24\lib\site-packages\django\utils\dateformat.py in d 107. self.data = dt 108. self.timezone = getattr(dt, 'tzinfo', None) 109. if hasattr(self.data, 'hour') and not self.timezone: 110. self.timezone = LocalTimezone(dt) 111. 112. def d(self): 113. "Day of the month, 2 digits with leading zeros; i.e. '01' to '31'" 114. return '%02d' % self.data.day #Here we get the error 115. 116. def D(self): 117. "Day of the week, textual, 3 letters; e.g. 'Fri'" 118. return WEEKDAYS[self.data.weekday()][0:3] 119. 120. def F(self): }}} I was able to reproduce the error with '''LANGUAGE_CODE''' set to 'sr', 'en' and 'de'. adrian Petar Marić <petar.maric@gmail.com> translation date time i18n 0 0 0 0 0 0
900 2005-11-24 14:34:52 2006-06-12 02:07:12 2019-06-24 00:24:51.664122 Unreviewed closed Database layer (models, ORM) defect major   duplicate [patch] Premature close of postgres connection with multiple threads Postgres back-end shares one connection for many requests. This is generally okay since psycopg handles this correctly. It looks like somewhere (I haven't found exact place yet) users of shared connection close it explicitly while other processes working with it. This results in other processes crash with the exception "already closed". I'm seeing this in action on a page with many images where each image generated by a view looking into database. When running under development server everything is ok since it' single-process. But when running under Apache with each reload some of the images sometimes turn blank. Exceptions of course aren't shown inside 'img' tags but I replaced them with &lt;object data="..." type="text/plain"&gt; and got the messages :-) I use apache2, mod_python, postgresql 7.4 For now as a workaround I just commented out whole DatabaseWrapper.close() so the connection is destroyed when Apache child is dying and killing the Interpreter (as I'm guessing). So my Postgres complains periodically about dropped connection. Is there any place where the destruction can be hooked at (I'm not familiar with WSGI and all this handlers stuff that close)? adrian Maniac <Maniac@SoftwareManiacs.Org>   0 1 0 0 0 0
909 2005-11-25 19:17:16 2005-11-26 17:01:38 2019-06-24 00:24:57.464387 Unreviewed closed Translations enhancement normal   duplicate update slovak (sk) translation update slovak (sk) translation hugo vlado@labath.org   0 0 0 0 0 0
924 2005-11-26 18:34:18 2007-01-23 23:01:36 2019-06-24 00:25:06.910242 Unreviewed closed contrib.admin defect normal   duplicate [patch] String filters (lower, upper, capfirst etc.) don't work with international strings String filters operate on 8-bit strigns but Python's useful string functions only work with international characters in unicode strings. UTF8ed strings are not changed. Patch follows. This, however, will break the patch in ticket 393 where it assumes a string passed to a filter to be 8-bit str. But I beleive this whole thing should be unicode. hugo Maniac <Maniac@SoftwareManiacs.Org>   0 1 0 0 0 0
930 2005-11-27 17:54:10 2006-10-07 23:14:03 2019-06-24 00:25:10.654874 Unreviewed closed Metasystem defect normal   duplicate [patch] Leaving out ¨ordering¨ in OneToOne relationship causes bad SQL statement Using Trunk rev-1461: Given the Model Foo: {{{ from django.core import meta # Create your models here. class Bar(meta.Model): class META: admin = meta.Admin() bardata = meta.CharField(maxlength=200) def __repr__(self): return self.bardata class Baz(meta.Model): class META: admin = meta.Admin() bazdata = meta.CharField(maxlength=200) bar = meta.OneToOneField(Bar) def __repr__(self): return self.bazdata }}} When you select ¨baz¨ from the main admin interface: You are greeted by the following: {{{ OperationalError at /admin/foo/bazs/ no such column: foo_bars.id Request Method: GET Request URL: http://127.0.0.1:8080/admin/foo/bazs/ Exception Type: OperationalError Exception Value: no such column: foo_bars.id Exception Location: /usr/lib/python2.4/site-packages/Django-0.90-py2.4.egg/django/core/db/backends/sqlite3.py in execute, line 71 }}} The offending SQL statement seems to be: {{{ SELECT "foo_bazs"."bazdata","foo_bazs"."bar_id" FROM "foo_bazs" ORDER BY "foo_bars"."id" DESC }}} Explicitly including an ¨ordering¨ in the ¨baz¨ class fixes this problem, but it should work properly without one. ALSO: Upon creation of a ¨baz¨, the admin interface of ¨baz¨ shows a label of ¨ID¨ folowed by a dropdown list containing bars followed by what seems to be the PK of said bar. What is the purpose of that number? Is it supposed to be there. Additionally, once a baz is saved, the dropdown list suggests, that corresponding bar for this baz can be changed, but saving the baz with a different bar does not seem to have any effect. russellm EABinGA   0 1 0 0 0 0
934 2005-11-27 20:00:37 2007-01-23 02:24:07 2019-06-24 00:25:13.153773 Unreviewed closed Validators defect normal   duplicate ImageField's cause the admin UI to not allow modifications? my model can be boiled down to: class TestAccount(meta.Model): photo = meta.ImageField(upload_to="/Users/davida/svk/bankofdad/m/photos", default='') def __repr__(self): return self.photo class META: ordering = ('-photo',) admin = meta.Admin() i can create TestAccount instances, but I can't go back and edit one and save. If I do, I always get: Enter a valid filename. in the field corresonding to the photo (this even if I browse... to another image). adrian David Ascher <david.ascher@gmail.com> david.ascher@gmail.com 0 0 0 0 0 0
935 2005-11-27 20:12:55 2006-10-22 16:25:58 2019-06-24 00:25:13.772026 Unreviewed closed contrib.admin defect normal   duplicate weird interaction between edit_inline and OneToOneField causes adding through admin to fail if I take a model like: {{{ class Account(meta.Model): user = meta.OneToOneField(auth.User, core=True) kid_name = meta.CharField(...) }}} which extends the User model, and then have: {{{ class Transaction(meta.Model): account = meta.ForeignKey(Account) value = meta.FloatField(max_digits=10,decimal_places=2, default=0) date = meta.DateField(default=datetime.datetime.today()) note = meta.CharField(maxlength=200, default='') }}} to associate many transactions w/ each account, everything works fine, including the admin pages. If I add "edit_inline=True, core=True" to the account ForeignKey description, then creating Accounts through the admin interface fails with an error: {{{ AttributeError at /admin/accounts/accounts/add/ 'Account' object has no attribute 'user' Request Method: POST Request URL: http://localhost:8000/admin/accounts/accounts/add/ Exception Type: AttributeError Exception Value: 'Account' object has no attribute 'user' Exception Location: /Users/davidascher/django/django/core/meta/__init__.py in manipulator_save, line 1754 }}} The request object looks like: <DjangoRequest GET:{}, POST:{'transaction.1.id': [''], 'transaction.1.date': ['2005-11-27'], 'transaction.2.value': ['0'], '_addanother': ['Save and add another'], 'transaction.0.date': ['2005-11-27'], 'transaction.2.note': [''], 'transaction.1.note': [''], 'balance_at_last_transaction': ['0'], 'last_transaction_date': ['2005-11-27'], 'transaction.0.value': ['0'], 'currency': ['CAD'], 'transaction.2.id': [''], 'user': ['1'], 'kid_name': ['asdas'], 'transaction.0.id': [''], 'transaction.2.date': ['2005-11-27'], 'pub_date': ['2005-11-27'], 'transaction.1.value': ['0'], 'transaction.0.note': ['']}, COOKIES:{'hotclub': 'a8625192d1938973fe717071e5202194'}, META:{'CONTENT_LENGTH': '420', 'CONTENT_TYPE': 'application/x-www-form-urlencoded', 'DJANGO_SETTINGS_MODULE': 'bankofdad.settings', 'GATEWAY_INTERFACE': 'CGI/1.1', 'GDK_USE_XFT': '1', 'HOME': '/Users/davidascher', 'HTTP_ACCEPT': 'text/xml,… adrian David Ascher <david.ascher@gmail.com>   0 0 0 0 0 0
940 2005-11-27 23:43:32 2007-07-12 18:00:14 2019-06-24 00:25:16.882154 Unreviewed closed *.djangoproject.com enhancement normal   duplicate Trac RSS feed link should be visible from Django's Trac Trac implements RSS feeds for recent activity; these feeds are available if you know how to construct a relevant URL, but they should be linked from Django's Trac installation for ease of discovery. Example: http://code.djangoproject.com/timeline?daysback=90&max=50&ticket=on&changeset=on&milestone=on&format=rss jacob Tom Tobin <korpios@korpios.com>   0 0 0 0 0 0
958 2005-11-28 16:19:12 2005-11-28 22:42:27 2019-06-24 00:25:28.289993 Unreviewed closed Metasystem defect normal   duplicate [patch] Allow non-int Primary Keys in ForeignKey {{{Index: /usr/local/django_src/django/core/meta/fields.py =================================================================== --- /usr/local/django_src/django/core/meta/fields.py (revision 1476) +++ /usr/local/django_src/django/core/meta/fields.py (working copy) @@ -722,7 +722,7 @@ if value == '' or value == None: return None else: - return int(value) + return value def flatten_data(self, follow, obj = None): if not obj:}}} adrian Boffbowsh   0 1 0 0 0 0
963 2005-11-30 01:25:59 2006-10-07 18:35:40 2019-06-24 00:25:31.424199 Unreviewed closed Database layer (models, ORM) defect normal   duplicate Save not working with non-integer foreign keys Hi Django Project. First off, Django rocks! However I ran into a little problem recently. I have a model with non-integer foreign keys (using strings - codes, etc.), and object.save() doesn't work because in fields.get_db_prep_save() the return statement says int(value). This appears to be a recent change, either late last week or early this week I think. Anwyay, that's my take on it, but you may have very good reasons for whatever the change was that is causing this behavior. Thanks, -James adrian jsprinklex9@yahoo.com   0 0 0 0 0 0
974 2005-12-01 07:38:20 2005-12-01 14:12:54 2019-06-24 00:25:38.342289 Unreviewed closed Core (Management commands) defect normal   duplicate sql and sqlall do not show DB statements for default values   adrian radek   0 0 0 0 0 0
980 2005-12-02 16:42:58 2006-01-27 16:07:49 2019-06-24 00:25:42.170710 Unreviewed closed Database layer (models, ORM) enhancement normal   duplicate Database Querying As it has been said before, the conflict between the rational SQL language and the procedural Python language mandates a perfect querying method to be impossible. However, there are some things we can do to make it nicer. Imagine a new method called "query", or what have you, that makes the querying process easier to read and simpler. == Operators == Firstly, the idea has been set forth, as in ticket #851, to use the comparison operators already defined in Python, i.e. {{{== < <= > >= !=}}}, instead of the underscore keywords we have now. The problem with doing this is that you need an object that can emulate numeric types. There are few ways of getting this object out, the most obvious is to have a class, for instance named "Field", that will intialize with a name argument. This can then interact with the operator. Like so: {{{ polls.query(Field('question') == 'What are you searching for?') }}} This is fine, and readable. But it forces us to put our field in a string and feels less OO, than it could. In ticket #851, it is suggested to make a 'q' object that returns a Field object for any property that is referenced on it. But I feel that 'q' isn't a very descriptive name, so I propose replacing it with 'field'. So {{{ field.question }}} is identical to the above {{{Field('question')}}}. {{{ polls.query(field.question == 'What are you searching for?') }}} Even better, if the pluralization of models was dropped, and you could access {{{Poll}}}, then you could do {{{Poll.question}}}, which seems the most natural. == Ands / Ors == Now, we must think of how to perform an OR operation. The obvious answer is to allow '|' to modify what we already have: {{{ choices.query(field.choice == 'A choice' | field.votes > 4) }}} Unfortunately, due to the operator precedence in Python, this doesn't work how we'd expect. Python thinks that it should {{{ 'A choice' | field.votes }}} before applying the comparison operators, which doesn't make any sense. The solution is to put p… adrian brantley (deadwisdom@gmail.com)   0 0 0 0 0 0
1003 2005-12-06 14:00:46 2006-10-07 13:13:09 2019-06-24 00:25:56.727680 Unreviewed closed contrib.admin defect normal master duplicate Global name 'rel_opts' is not defined (problem with deleting) I'm not sure what {{{rel_opts}}} is referring to. Should it be {{{related.opts}}} instead? {{{ Traceback (most recent call last): File "/home/j/jason/django_src/django/core/handlers/base.py", line 74, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/home/j/jason/django_src/django/contrib/admin/views/decorators.py", line 49, in _checklogin return view_func(request, *args, **kwargs) File "/home/j/jason/django_src/django/contrib/admin/views/main.py", line 639, in delete_stage _get_deleted_objects(deleted_objects, perms_needed, request.user, obj, opts, 1) File "/home/j/jason/django_src/django/contrib/admin/views/main.py", line 567, in _get_deleted_objects if rel_opts.admin: NameError: global name 'rel_opts' is not defined }}} adrian Esaj <jason at jasondavies.com>   0 0 0 0 0 0
1007 2005-12-06 20:21:58 2007-09-16 13:00:54 2019-06-24 00:25:59.254616 Accepted closed Database layer (models, ORM) defect normal   duplicate [patch] Add support for a faux ON DELETE RESTRICT functionality I wanted a way to specify that records should not be deleted if they have other records associated with them, similar to SQL's 'ON DELETE RESTRICT'. Currently the only documented behavior for Django is closer to an in-code 'ON DELETE CASCADE'. To make things a little more complex, I also wanted to quantify what's checked for in the 'RESTRICT'--specifically, sub-items of a record, such as an Address for a Contact, should NOT be part of the RESTRICT, but other, more complex relationships should be checked. This patch adds a 'restrict_delete' keyword to the META classes of Model classes, which is a boolean that defaults to False (e.g. the normal CASCADE behavior). If this is set to True for a Model class, the following happens on a call to the .delete() method of that class's instances: * A set consisting of all related fields is constructed, mirroring the calls used to find out what to delete. * Any fields marked as 'follow' (this includes the implicit 'follow' set on things edited_inline) are taken ''out'' of this set - they are the 'sub-items' mentioned above. * Calls to get_count for the remaining related fields are made, and if any are non-zero, an AssertionError is raised and the deletion does not occur. This is primarily to scratch a personal itch for a project, but I assume others may want the functionality, and I certainly think that the core devs would want to review delete()'s current behavior at some point as it's quite inflexible. I've seen one unanswered question on django-users asking for something like this, for example :) nobody bitprophet   0 1 1 1 1 0
1010 2005-12-06 22:38:08 2006-10-07 18:31:50 2019-06-24 00:26:01.154003 Unreviewed closed Core (Other) defect critical master duplicate rev 1560 fails to save object Development server revision 1560. After updating from I don't know which revision, A model that has the following fields: ForeignKey IntegerField CharField When I create a new object for the model do a save() on the object, get this: ------------------------ Traceback (most recent call last): File "do_ldap.py", line 361, in ? Main() File "do_ldap.py", line 358, in Main add_update_grouptable(server_id='xxx') File "do_ldap.py", line 328, in add_update_grouptable add_g.save() File "/apps/django/lib/django/utils/functional.py", line 3, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/apps/django/lib/django/core/meta/__init__.py", line 1012, in method_save db_values = [f.get_db_prep_save(f.pre_save(getattr(self, f.attname), True)) for f in opts.fields if not isinstance(f, AutoField)] File "/apps/django/lib/django/core/meta/fields.py", line 725, in get_db_prep_save return int(value) ValueError: invalid literal for int(): xxx -------------------------------------- From the source code in fields.py: def get_db_prep_save(self,value): if value == '' or value == None: return None else: return int(value) ------------ The above if a method from the ForeignKey field, I did pass the foreign key object to when creating the object. Please can this be fixed asap. adrian anonymous Revision 1560 0 0 0 0 0 0
1018 2005-12-07 12:14:07 2006-10-07 18:54:40 2019-06-24 00:26:06.090975 Unreviewed closed Documentation enhancement normal   duplicate Printable Documentation It would really be helpful if documentation (API reference, sample tutoral, etc.) was available in printable format like PDF. This would help greatly in create apps. Especially the tutorial since the code changes a lot. jacob Burhan   0 0 0 0 0 0
1047 2005-12-12 15:14:36 2007-07-03 23:11:31 2019-06-24 00:26:24.221565 Design decision needed closed Core (Cache system) defect normal   duplicate bug in decorator_from_middleware function when i use cache_page decorator in Python24, I found {{{ @cache_page( 60 * 15 ) def some_view( request ): pass }}} not equals {{{ def some_view( request ): pass some_view = cache_page( some_view , 60 * 15 ) }}} it equals {{{ def some_view( request ): pass some_view = cache_page(60*15)( some_view ) }}} so i think zhe 'cache.txt' and zhe decorator_from_middleware function should be fixed for this bug. bug i don't know how to do that. BTW:the cache system is so cool. :D jacob junzhang.jn@gmail.com   0 0 0 0 0 0
1051 2005-12-13 03:27:20 2010-11-24 19:34:01 2019-06-24 00:26:26.721646 Design decision needed closed Database layer (models, ORM) enhancement normal master duplicate Add support to set search_path in PostgreSQL Sometimes PostgreSQL schemas feature is very helpful to developers: we can use this feature to maintain multiple versions of databases, or integrate external PostgreSQL databases by cross-schema view without making database organization confusing. So it seems necessary to add PostgreSQL schemas support to django:) I implemented this feature over only four lines. First, one additional field, "DATABASE_SCHEMAS" in django setting, is used to control PostgreSQL schemas setting, default is blank; second, when initializaing database cursor, three hook codes will double check DATABASE_ENGINE and DATABASE_SCHEMAS, if DATABASE_SCHEMAS is not blank and DATABASE_ENGINE is postgresql, django will set postgresql to appropriate schemas search order. For PostgreSQL schemas detail, please refer to this url: http://www.postgresql.org/docs/8.0/static/ddl-schemas.html nobody Mao Xizeng <mao.xizeng@gmail.com> PostgreSQL Schemas 0 1 0 1 0 0
1057 2005-12-13 22:38:51 2005-12-13 22:42:16 2019-06-24 00:26:30.576574 Unreviewed closed Core (Other) enhancement normal   duplicate cannot set SESSION_COOKIE_AGE to None If I want to use the Session Middleware to set the initial cookie to be only valid for the browser session (meaning would like to expire it after the browser is closed), I get this: Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/apps/python/v2/v242/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/apps/django/lib/django/core/handlers/modpython.py", line 165, in handler return ModPythonHandler()(req) File "/apps/django/lib/django/core/handlers/modpython.py", line 145, in __call__ response = middleware_method(request, response) File "/apps/django/lib/django/middleware/sessions.py", line 73, in process_response datetime.datetime.now() + datetime.timedelta(seconds=SESSION_COOKIE_AGE)) TypeError: unsupported type for timedelta seconds component: NoneType Basically, I would like the cookie to be not stored on disk by the clients browser, achieved by setting max_age=None (?). Maybe have a separate variable for the session database? adrian anonymous   0 0 0 0 0 0
1069 2005-12-15 23:38:09 2007-09-16 13:24:42 2019-06-24 00:26:38.069076 Accepted closed Core (Other) defect normal   duplicate Fire a signal after save of related objects Right now _post_save is called directly after saving the given object. Often it is needed that a method is called after the manipulator finishes saving the object and all related objects, for that I propose the attached patch adding a _post_total_save hook called from the manipulator. nobody wojtek@brandlay.com feature_request 0 1 1 1 1 0
1097 2005-12-21 11:09:04 2006-10-16 15:09:24 2019-06-24 00:26:55.862701 Unreviewed closed Documentation enhancement normal   duplicate Add deployable example configs for mod_python/FastCGI/SCGI/Lighttpd etc There's enough real-world experience of deploying Django out there now that we should be able to gather together example configuration files for all kinds of different setups. Let's add a directory to the Django distribution (maybe docs/deployment or something) which contains a collection of almost-ready-to-go configuration files for Apache 1.3/2, Lighttpd and so on covering the various ways in which Django can be deployed using them. Ideally people should be able to install the web server of their choice, drop in a config file we've provided, change one or two settings in it (the location of their code base, the domains hosted by the server) and start it up. This would make deploying Django faster and easier, and would emphasize the production-ready nature of the framework. For bonus points, comment the example configs heavily with tips on tweaking or improving performance once you're up and running. jacob Simon Willison   0 0 0 0 0 0
1105 2005-12-22 02:38:20 2010-09-11 18:46:08 2019-06-24 00:27:00.934063 Design decision needed closed Template system defect normal   duplicate [patch] simple_tag decorator enhancement Attached is a patch for a tag function decorator that I find useful. It's a simple extension of Robert's simple_tag. The tag function is passed the context as the first argument and also any arguments to the tag, resolved in the same way as for the simple_tag decorator. The decorated function can manipulate the context and either return a string, which will be inserted into the template, or None. For example, this tag puts the project settings into the context: {{{ @register.simple_tag_with_context def get_settings(context): """ Put the project settings into the context. Usage:: {% get_settings %} """ from django.conf import settings context['settings'] = settings }}} And this one is the equivalent of the existing simple_tag example in NewAdminChanges: {{{ @register.simple_tag_with_context def monkey_tag(context, verb): return "I %s no evil" % verb }}} julien django@kieranholland.com   0 1 1 1 1 0
1119 2005-12-26 18:13:37 2006-10-07 14:51:44 2019-06-24 00:27:09.828233 Unreviewed closed Generic views defect normal   duplicate Time zone configuration does not work properly I'm developing my Django programs under Windows, which is set to local time, the time zone being Europe/Berlin. When I set TIME_ZONE in my settings.py to 'Europe/Berlin' Django sets the offset to GMT to zero (determined by item.date|date:"d.m.Y H:i O" in a template) and the time returned by datetime.now() is one hour earlier then it is on my computer (the time shown in the log, e.g. [26/Dec/2005 ...] is also one hour too early). The only way of correcting it, seems to set TIME_ZONE to 'GMT-1', which is not true for Germany (and does not respect daylight saving). jacob Marek Kubica   0 0 0 0 0 0
1120 2005-12-26 18:22:46 2007-07-03 23:11:06 2019-06-24 00:27:10.424235 Ready for checkin closed django-admin.py runserver defect minor   duplicate Development server ignores changing the TIME_ZONE information While I was trying different time zones in settings.py (edit the file, save it, see the development server reloading) I noticed that the change of TIME_ZONE does not affect the server. You have to stop the server completely and restart it to let it see the change. adrian Marek Kubica   0 0 0 0 0 0
1127 2005-12-27 14:28:26 2006-05-05 04:23:29 2019-06-24 00:27:14.852466 Unreviewed closed Template system defect normal master duplicate ifequal template tag does not accept hardcoded strings containing spaces This works: {{{ {% ifequal test "test" %} foo... {% endifequal %} }}} This not: {{{ {% ifequal test "test 2" %} foo... {% endifequal %} }}} Suggested patch: {{{ django/trunk/django/core/defaulttags.py =================================================================== --- defaulttags.py (revision 1782) +++ defaulttags.py (workcopy) @@ -479,7 +479,16 @@ ... {% endifnotequal %} """ - bits = token.contents.split() + tmpbits = token.contents.split() + bits=[] + sep="" + for i in tmpbits: + if(sep): + bits[-1]+=" "+i + if(i[-1]==sep):sep="" + else: + bits.append(i) + if(i[0]=="'" or i[0]=='"'):sep=i if len(bits) != 3: raise TemplateSyntaxError, "%r takes two arguments" % bits[0] end_tag = 'end' + bits[0] }}} I'm afraid this is not an elegant solution. I think it must to be done in other template tags that uses token.contents.split() and are supposed to accept hardcoded strings. I think django/trunk/tests/othertests/templates.py must be also changed. adrian elcio@elcio.com.br   0 0 0 0 0 0
1132 2005-12-28 22:15:00 2006-10-22 16:03:54 2019-06-24 00:27:18.065308 Unreviewed closed Core (Other) enhancement normal   duplicate [patch] CurrentUserField and manipulator changes This isn't as high level as I would like, but it works. It's also still usable without access to a request object as well. It feels like a hack to me, but no more so than DateField's auto_now and auto_add_now. I played around with using events, and even with RuleDispatch, but this was the simplest change that worked. It doesn't work for inline objects yet though. I figured I'd get some feedback before I waste my time. Here's how to use it: {{{ class Article(meta.Model): title = meta.CharField(maxlength=100) body = meta.TextField() added_by = meta.CurrentUserField(update_on_edit=False) # only save the current user in add_stage edited_by = meta.CurrentUserField() # update_on_edit defaults to True }}} adrian jkocherhans <jkocherhans@mac.com>   0 1 0 0 0 0

Next page

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE "tickets_full" (
        id int primary key,
        created datetime,
        changetime datetime,
        last_pulled_from_trac datetime,
        stage text,
        status text,
        component text,
        type text,
        severity text,
        version text,
        resolution text,
        summary text,
        description text,
        owner text,
        reporter text,
        keywords text,
        easy boolean,
        has_patch boolean,
        needs_better_patch boolean,
        needs_tests boolean,
        needs_docs boolean,
        ui_ux boolean
    );
Powered by Datasette · Query took 1321.042ms