Last active
April 26, 2020 02:45
-
-
Save tacianosilva/d3d8f22b80bb5b810cdd4fd3cd0d4bac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_horarios_str(self): | |
ret = '' | |
print(self.horarios.all()) | |
# use models.ManyToMany field's all() method to return all the Department objects | |
# that this employee belongs to. | |
for horario in self.horarios.all(): | |
ret = ret + horario.__str__() + ',' | |
# remove the last ',' and return the value. | |
return ret[:-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment