widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #08206
Re: [Merge] lp:~widelands-dev/widelands-website/move_minimaps into lp:widelands-website
> But using the string from 'upload_to' couldn't be implemented in this branch because os.path.join wouldn't work on some places right now.
makes sense - leave a TODO in places where you plan to make changes eventually, but not right now for posterity.
> In case of making it so, we may have to disable map uploading for at least 30 minutes i think.
sounds uncritical to me - we can totally do that.
[Plan of action]
I think your cleanup plan is a good one - cleanups are never a waste of time IMHO, they reduce technical debt. I think the way to describe doing it is feasible - and safe. what I would do instead is using ./manage.py shell and hack in the changes you need to do to the database there - quick example (copy & pasted and edited, I did not change the actual database):
$ ./manage.py shell
In [2]: from wlmaps.models import *
In [3]: maps = Map.objects.all()
In [4]: maps[0]
Out[4]: <Map: Large Ocean by Teayo>
In [5]: maps[0].minimap
Out[5]: <ImageFieldFile: /wlmaps/maps/Large Ocean.wmf.png>
In [6]: maps[0].minimap??
Object `minimap` not found.
In [7]: maps[0].minimap
Out[7]: <ImageFieldFile: /wlmaps/maps/Large Ocean.wmf.png>
In [8]: maps[0].minimap = "/new/path"
In [9]: maps[0].save()
this could be done in a script in a `for map in Map.objects.all()` loop and would therefore not require a change to the source code.
--
https://code.launchpad.net/~widelands-dev/widelands-website/move_minimaps/+merge/303493
Your team Widelands Developers is subscribed to branch lp:widelands-website.
References