Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#9991 closed (fixed)

manage.py inspectdb guesses TextField on postgres' real column

Reported by: Jerome Leclanche Owned by: Peter Bengtsson
Component: django-admin.py inspectdb Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Ramiro Morales)

Using python manage.py inspectdb outputs a models.TextField type as guess for every 'real' (float4) column when using postgresql (psycopg2). Example:

    modifier_float = models.TextField() # This field type is a guess.

Quick fix: Append "700: 'FloatField'" to postgres' introspection.py's data_types_reverse dict. SVN is acting weird and I don't really know django's underlying codebase, so I rather let someone else patch this (or explain why it's intended).

Attachments (1)

9991.patch (477 bytes ) - added by Peter Bengtsson 15 years ago.
The patch. Only tested this manually. Working on how to write tests for this.

Download all attachments as: .zip

Change History (9)

comment:1 by Ramiro Morales, 15 years ago

Description: modified (diff)

(edited description)

comment:2 by Jacob, 15 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 by Russell Keith-Magee, 15 years ago

Component: Uncategorizeddjango-admin.py inspectdb

comment:4 by Peter Bengtsson, 15 years ago

Owner: changed from nobody to Peter Bengtsson
Status: newassigned

I'm happy to write a patch

by Peter Bengtsson, 15 years ago

Attachment: 9991.patch added

The patch. Only tested this manually. Working on how to write tests for this.

comment:5 by Peter Bengtsson, 15 years ago

Resolution: fixed
Status: assignedclosed

There are no tests for any management commands. Feel way to junior in this codebase to know how to start adding these kind of tests since they're non-trivial.
Happy to help if someone more senior can get me started.

comment:6 by Ramiro Morales, 15 years ago

Resolution: fixed
Status: closedreopened

Restoring ticket status

comment:7 by Jacob, 15 years ago

Resolution: fixed
Status: reopenedclosed

(In [10380]) [1.0.X] Fixed #9991: correctly introspect PostgreSQL 'real' types. Backport of r10379 from trunk.

comment:8 by Jacob, 12 years ago

milestone: 1.1

Milestone 1.1 deleted

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