maxtepkeev / architect

A set of tools which enhances ORMs written in Python with more features
Other
391 stars 57 forks source link

Django Translations getting in the way #21

Closed Archarachne closed 8 years ago

Archarachne commented 8 years ago

Hi!

I tried to use architect but I encountered a problem I don't really know how to handle. I described it here: http://stackoverflow.com/questions/33260386/partitioning-django-with-architect-package-translation-error

I don't know if it is the Architect issue or my lack of knowledge how to handle Django, but if you could help me on the subject I would be grateful.

maxtepkeev commented 8 years ago

Hi!

Can you please provide me with the example of the code you're using, so I could reproduce your error here, thanks.

Archarachne commented 8 years ago

I cannot provide you with the original code unfortunatelly (it's from my work), but if you could maybe try create a Model with a field using:

from django.utils.translation import ugettext as _

class Model(models.Model): uuid = models.CharField(_("Model ID"), null=False, max_length=32)

And then run the architect partition command. It should throw the error I've provided you with on stackoverflow.

maxtepkeev commented 8 years ago

I'm getting the same error with your code, but switching to ugettext_lazy resolves this issue for me, so you can use this for now. I don't have much time to investigate this right now, but I'll try to do this on the weekend. So for now you can use ugettext_lazy. After I'll get more info, I'll post a reply here.

Archarachne commented 8 years ago

Thanks, that would be great! The project is huge and now I have to work my way on it to switch to lazy translations, but some where done like that for a reason. I'll be watching this issue.

maxtepkeev commented 8 years ago

Fixed in v0.5.3