You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can confirm that it doesn't work quite right with multiple o2o's, but it seems to SOMETIMES create more than one. On my current project, I have a model with 5 AutoOneToOne fields. On the initial save, 2 or sometimes 3 o2o models are created, but never all 5
@wess, in case you're wanting the models to be immediately visible in the admin after a save, here's a quick hack that seems to work. put this in your str model method(or unicode if you're using python 2):
for x in self._meta.related_objects:
if x.one_to_one:
hasattr(self, x.get_accessor_name())
It isn't reliable in the save method for some reason, though
When you have, say, 3 models, 1 is primary, and the other 2 both have AutoOneToOneField, only one model/relationship is auto created.
The text was updated successfully, but these errors were encountered: