Answer the question
In order to leave comments, you need to log in
Am I doing OOP correctly?
I am writing my library for working with images. Haven't added all the features yet.
I would like to hear criticism from professional developers on my code, maybe where something is wrong or where it could be easier to do, since I'm a beginner
https://gist.github.com/kentuck13/2079114d28fe4019...
Upload.save_files call (image, 'product', new_obj.id)
Answer the question
In order to leave comments, you need to log in
Small remarks on the code:
1) path = Upload.get_path(folder_name, id)
You are using class calls in a slightly different way within itself. Read about self :
2) Why do you need so many @staticmethod
? Remove everything except get_path, substitute self everywhere and read the first note.
3) from poliv.settings
. Why not from poliv.nastroiki
?
4) get_files, return images
. Read about yield
5) Use at least numbers for format, but rather name it:
"""<img src="{image}" style="max-width: 250px; width:100%" class="{class}">""".format(
image=images_path + file, class=i_class)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question