Code review comment for lp:~arashbm/cliffhanger/person-movie-backend

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

As usual great work! I have one question regarding the Movie.qml and Person.qml Models. In their model definition why do you define default_attributes if you are anyway going to add additional items to the attribute variable? I feel like the defaultAttributes variables is just unnecessary. Thoughts?

180 + property variant defaultAttributes: {
181 + 'title': '',
182 + 'homepage': '',
183 + 'tagline': '',
184 + 'overview': '',
185 + 'releaseDate': '',
186 + 'runtime': '',
187 + 'voteAverage': '',
188 + 'voteCount': '',
189 + 'genres': [],
190 + 'thumb_url': ''
191 + }

202 + attributes = {
203 + 'id': ob.id,
204 + 'title': ob.title,
205 + 'homepage': ob.homepage,
206 + 'tagline': ob.tagline,
207 + 'overview': ob.overview,
208 + 'releaseDate': ob.release_date,
209 + 'runtime': ob.runtime,
210 + 'voteAverage': ob.vote_average,
211 + 'voteCount': ob.vote_count,
212 + 'genres': ob.genres,
213 + 'thumb_url': thumbnail_url(ob.poster_path),
214 + 'creditsJson': JSON.stringify(ob.credits || {}),
215 + 'similarMoviesJson': JSON.stringify(ob.similar_movies || {})
216 + };

review: Needs Information

« Back to merge proposal