Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#7742 closed (fixed)

remove oldforms

Reported by: gwilson Owned by: gwilson
Component: Core (Other) Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

A ticket for tracking the removal of the django.oldforms package, which will be performed after all remaining oldforms dependencies have been removed. Work consists of:

  • Removing django.oldforms.
  • Removing oldforms documentation and all references to oldforms.

To follow/assist this work, see my bzr branch.

Attachments (4)

7742.diff (141.0 KB) - added by gwilson 7 years ago.
7742.2008-08-26.diff (139.9 KB) - added by gwilson 7 years ago.
patch updated for docs and comments merge
7742.2008-08-26.2.diff (154.9 KB) - added by brosner 7 years ago.
7742.2008-08-26.3.diff (154.4 KB) - added by brosner 7 years ago.

Download all attachments as: .zip

Change History (24)

comment:1 Changed 7 years ago by Simon Greenhill

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by mir

Since the comment system will continue to use oldforms in 1.0, shouldn't this be a post-1.0?

comment:3 Changed 7 years ago by russellm

mir: Comments is one of the special cases. Thejaswi Puthraya is working on comments as part of the GSOC; unless I've missed a memo, this is still on the cards to happen.

comment:4 Changed 7 years ago by gwilson

oldforms is still being used in the following locations:

  • django.contrib.admin.views.template - template_validator view and TemplateValidator manipulator class.
  • django.contrib.comments.views.comments - multiple forms.
  • In the methods prepare_field_objs_and_params and get_manipulator_field_objs in the following files:
    • django.contrib.contenttypes.generic - GenericRelation model field subclass.
    • django.db.models.__init__
    • django.db.models.related
    • django.db.models.manipulators

Also, while not using the oldforms package directly, the following model field methods (noted by Russell on #7830) are related to oldforms:

  • get_manipulator_field_names()
  • get_manipulator_fields()
  • get_manipulator_new_data()
  • flatten_data()
  • get_choices()
  • get_choices_default()

comment:5 Changed 7 years ago by gwilson

  • Status changed from new to assigned

comment:6 Changed 7 years ago by gwilson

(In [8292]) Refs #7742 -- newforms-admin does not use oldforms validator_list argument, made a custom FlatPageForm to check the entered URL.

comment:7 Changed 7 years ago by gwilson

(In [8293]) Refs #7742 -- Removed unused validator_list argument (this is already being checked by the UserCreationForm).

comment:8 Changed 7 years ago by gwilson

(In [8295]) Refs #7742 -- Removed oldforms bits from contrib.gis app.

comment:9 Changed 7 years ago by gwilson

I'm attaching a patch to see what this is looking like. contrib.comments is still blocking this, and I haven't yet looked into whether get_choices and get_default_choices can be removed or not.

Changed 7 years ago by gwilson

comment:10 Changed 7 years ago by mtredinnick

  • milestone changed from 1.0 beta to 1.0

The remaining portions of this are no longer 1.0-beta. Changing the milestone (ideally to 1.0-ASAP :-) ).

Changed 7 years ago by gwilson

patch updated for docs and comments merge

comment:11 Changed 7 years ago by gwilson

Here's my commit message draft:

Removed oldforms and oldforms-related code:

  • Removed Manipulator, AutomaticManipulator, and related classes.
  • Removed oldforms specific bits from model fields:
    • Removed validator_list argument in constructors.
    • Removed the methods:
      • get_manipulator_field_names
      • get_manipulator_field_objs
      • get_manipulator_fields
      • get_manipulator_new_data
      • prepare_field_objs_and_params
      • get_follow
    • Renamed flatten_data method to get_string_value for better alignment with its use by the serialization framework, which was the only remaining code using flatten_data.
  • Removed oldforms methods from django.db.models.Options class: get_followed_related_objects, get_data_holders, get_follow, and has_field_type.
  • Serialization framework
    • Serializer.get_string_value now calls the model fields' renamed get_string_value methods.
    • Removed a special-casing of models.DateTimeField in core.serializers.base.Serializer.get_string_value that's handled by django.db.models.fields.DateTimeField.get_string_value.
  • Introduced a SlugField form field for validation (refs #8040).
  • Removed an oldforms-style model creation hack (refs #2160).

comment:12 follow-up: Changed 7 years ago by brosner

I don't see the reason why we should still accept core. It is no longer used in the admin.

comment:13 Changed 7 years ago by anonymous

  • Has patch set

comment:14 in reply to: ↑ 12 Changed 7 years ago by kmtracey

Replying to brosner:

I don't see the reason why we should still accept core. It is no longer used in the admin.

Yes, I was wondering why it was still documented, even in the new docs:

http://docs.djangoproject.com/en/dev/ref/models/fields/#common-model-field-options

It needs to be made go away, I think. It's now both confusing and useless?

comment:15 Changed 7 years ago by jacob

Indeed - Gary, you can add removing core and its documentation to this patch; from there I don't see anything else that you need to wait on to commit this.

Changed 7 years ago by brosner

comment:16 Changed 7 years ago by brosner

I have updated the patch to remove core and the various admin options that needed to get removed. Also I noticed that there was revert of [8477]. Gary, the second to last item in your commit message draft was fixed.

comment:17 Changed 7 years ago by brosner

Hrm, whoops should git svn rebase a bit more often. Let me attach a fixed patch. I noticed a couple more things.

Changed 7 years ago by brosner

comment:18 Changed 7 years ago by brosner

Here is a revised commit message draft that can be used.

Removed oldforms and oldforms-related code:

  • Removed Manipulator, AutomaticManipulator, and related classes.
  • Removed oldforms specific bits from model fields:
    • Removed validator_list argument in constructors.
    • Removed the methods:
      • get_manipulator_field_names
      • get_manipulator_field_objs
      • get_manipulator_fields
      • get_manipulator_new_data
      • prepare_field_objs_and_params
      • get_follow
    • Renamed flatten_data method to get_string_value for better alignment with its use by the serialization framework, which was the only remaining code using flatten_data.
  • Removed oldforms methods from django.db.models.Options class: get_followed_related_objects, get_data_holders, get_follow, and has_field_type.
  • Removed oldforms-admin specific options: core, num_in_admin, min_num_in_admin, max_num_in_admin, num_extra_on_change, edit_inline
  • Serialization framework
    • Serializer.get_string_value now calls the model fields' renamed get_string_value methods.
    • Removed a special-casing of models.DateTimeField in core.serializers.base.Serializer.get_string_value that's handled by django.db.models.fields.DateTimeField.get_string_value.
  • Removed an oldforms-style model creation hack (refs #2160).

comment:19 Changed 7 years ago by gwilson

  • Resolution set to fixed
  • Status changed from assigned to closed

fixed in [8616].

comment:20 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top