#11636 closed defect (duplicate)
can't import time, changetime
Reported by: | Owned by: | François Granade | |
---|---|---|---|
Priority: | normal | Component: | TicketImportPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
i'm trying to switch from spiceworks (ew) to trac (yay) and trying to get our old tickets out of it. i know this isn't the goal of this plugin but that its purpose has veered more towards this over time. i finally got some nice xls files ready to go with proper time, changetime fields. however, no matter what i do to the format in either the xls file or in trac.ini, i am faced with an error.
from what i gather by mousing over datetimes in trac, it appears that the standard format is %m/%d/%Y %H:%M:%S, so i edited my datetimes in the xls and get an error: ValueError: invalid literal for int() with base 10: '02/11/13'
so then i tried to stick with the native format from spiceworks, e.g. 2013-11-02 @ 05:15 pm so i edited trac.ini as such:
[importer] datetime_format=%Y-%m-%d %I:%M %p
same problem, more or less: ValueError: invalid literal for int() with base 10: '2013-02-11 @ 05:28 pm'
Attachments (0)
Change History (6)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
derp, sorry. that's what i meant i had for datetime_format, sorry.
i now have the xls with e.g.: 2013-02-11 05:28 PM
and:
[importer] datetime_format=%Y-%m-%d %I:%M %p
and: ValueError: invalid literal for int() with base 10: '2013-02-11 05:28 PM'
comment:3 Changed 11 years ago by
i don't know if this helps but i thought i saw the code was:
format_time(int(cell))
or something of the sort.
just popping open python, trying to do the string→int cast, it fails with a similar error, e.g.:
>>> int('2013-02-11') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for int() with base 10: '2013-02-11'
not sure that's helpful, but hey.
comment:4 Changed 11 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
A duplicate of #4783. The plugin currently doesn't support for ticket.time
and ticket.changetime
.
comment:5 follow-up: 6 Changed 11 years ago by
the import page lists all the available fields. you should get rid of time and changetime from the list until it's possible to use them. that would make it far less confusing!
it would also be good to explain that the datetime_format variable is useful only for custom (string) date fields.
comment:6 Changed 11 years ago by
the import page lists all the available fields. you should get rid of time and changetime from the list until it's possible to use them. that would make it far less confusing!
Okay. That's not good. The following patch don't show time
and changetime
for valid fields. I'll push it later.
-
talm_importer/importer.py
89 89 req.session['importer.uploadedfile'] = None 90 90 req.session['importer.uploadedfilename'] = None 91 91 92 ticket_fields = TicketSystem(self.env).get_ticket_fields() 92 93 data = { 'reconciliate_by_owner_also': self._reconciliate_by_owner_also(), 93 'fields': ['ticket or id'] + [field['name'] for field in TicketSystem(self.env).get_ticket_fields()], 94 'fields': ['ticket or id'] + \ 95 [field['name'] 96 for field in ticket_fields 97 if field['name'] not in ('time', 'changetime')], 94 98 'csv_default_encoding': self.csv_default_encoding, 95 99 'encodings': self._get_encodings() } 96 100
I've post patch to support time
field. But the patch is too old and should be refreshed.
If I read the error correctly, you have a datetime that contains an "@" between the day and the time
you may want to try:
it may work, but I'm not sure. Probably a safer way is to review your spreadsheet, search (and remove) the "@ " (with a space).