Meeting Minutes for Group B – February 9th, 2013

Announcements

Announcements:

It’s been far, far, far too quiet in IRC. Your mentors are starting to get freaked out.
This has been a very unusual semester so far – normally, we would have seen more traffic, more questions and it’s been super-silent.
Which means one of several things:

  • You’re all coming along just swimmingly, and aren’t running into any difficulties whatsoever
  • You’re not working enough on the project, and don’t have any questions because you haven’t put in enough time yet
  • You’re working on the project, and are running into difficulties, but you aren’t asking questions

2 and 3 are a problem. If you fall into either of these categories, it’s time to stop being there. You should definitely be putting time into this course. You should also definitely be asking questions. So, unless you fall into group 1, we should have seen more questions by now. Don’t wait for the meeting to ask questions. Please ping us on IRC anytime during the week We might not respond right away, but our bouncers will record what you’re asking and we’ll respond to you. Alternatively, send mail to reviewboard-dev or reviewboard-students. Please ask questions when you’re stuck. It’s that simple.

Question Period

Q: Which does python-codes control templates? (esp. “templates/accounts”)

A: are you asking about templatetags? The commands inside of templates? Or are you asking how Django renders templates? Or how the template folders are structured? Or something else entirely? We’d be happy to answer for any of those, but I recommend keeping this bookmarked:https://docs.djangoproject.com/en/dev/ref/templates/  That’s basically a complete reference to everything related to Django templates. Could you please rephrase your question?

Q: RB may use django’s template function but i couldn’t find which code control them.

A: Django has a ton of built-in template functions RB will call render_to_response and pass the template name and some variables (a “RequestContext”) that the template can use. Here’s a big list: https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs. Django provides all the special tags (like {% if %}) in the template. So a template is just HTML + those tags. I should also point out that Django’s templating language is extensible. We can provide our own templatetags – we have one called “commentcounts” for example, that returns a JSON array of comments for a filediff.

Q: i don’t understand what i have to change code

A: so, that’s where the templates are stored. so, the first big question is: “Where is the user page template?” This is the question you should have asked. And that’s something we can totally answer. you can find the user page template at reviewboard/reviewboard/templates/reviews/user_page.html. so this answers your first question, where is the user page template. What is your next question?

Q: which does code control them? reviewtags?

A: Django’s built-in templating support basically takes care of it for you look at the ‘submitter’ function in reviews/views.py. This is what renders using that template https://github.com/reviewboard/reviewboard/blob/master/reviewboard/reviews/views.py#L919. this function is what is executed when someone goes to /users/[some user name] https://github.com/reviewboard/reviewboard/blob/master/reviewboard/reviews/views.py#L949 this line is what is rendering the template. We’re doing this in a kind of special way here because of the datagrid.

Q: I tried to fix issue3780. I cannot write code here… http://pastie.org/6107716 . this is function related syncnum (widgets.py). it generate cache at line 2

A: it *might*. cache.add(KEY, 1) will only set the value of KEY to 1 if and only if that value is not currently being stored already. so if no value exists for KEY, cache.add(KEY, 1) will set the value to 1. but if a value *does* exist for KEY. this line is a no-op. no-op = does not do anything. which I think is what you want, is it not? the cache is a very simple key / value store. with the caveat that things might disappear from it over time. it only stores the data you give it okay. in your case, it’s storing 1, and later it’s incrementing the stored number. but it can store strings too. for example, generated templates are converted into strings and stored in there. er, by generated templates, I think I mean rendered templates.

Q: have some questions about datagrids.

A: Datagrids power things like the dashboard They take a query, a list of columns, and can render the data for each result in the query, given the columsn that are turned on. and they do things like allow the user to choose which columns they want to see, in what order, etc. which part?

Q: I’ve seen a few cases where groups are requested, and it seems like whatever was returned was in a  list format, more so confirmation.

A: do you have a function you can point to? there might be something being done that’s fed into a datagrid, or used to choose a datagrid’s query. the base datagrids don’t know anything about the data coming in. They leave it up to a subclass (things in reviews/datagrids.py) to say what data to render, what the query should be, default columns, etc.

Q: like i said, i was just curious, I’m not directly dealing with it right now so i don’t have a specific reason/function.  i’ve got a few more related questions though for my task.

A: ok.I’d be happy to walk through this in more detail after the meeting or any time this week

Q: Like i said in my report, today and tonight is my coding day, so, I’m come up with a question or two over the past few hours. so i’ve successfully been able to convert a review request into it’s appropriate url link within the review_request_box.html . however, i’m struggling to find how to convert a draft it seems like the _get_review_request function in the draftreviewrequest model is private. i have no way to break into it’s review request to get the id. should i just make it a standard public function, or would you suggest another route.

A: most places that deal with a draft also have the review request handy where is this? if you have the draft model, you can just follow the fields draft.review_request.get_absolute_url(). when there’s a foreign key relation, when you access that field it’ll give you an instance of the target model. is this in a template or python code?

Q: I’m using it in the review_request_box.html, through the models.py of reviews

A: So in there, {{review_request}} should point to the review request you care about ({{review_request_details}} may be a review request or a draft, depending on the state) does that clear it up?

Q: yup, i’ll work with this to go forward. so when a user types in a new field within _box.html, if it’s incorrectly entered or something wrong, we get the red error box

A: right. https://github.com/reviewboard/reviewboard/blob/master/reviewboard/static/rb/js/reviews.js#L166 This does that

Q: I added Trophy model and changed LocalSiteProfile model at reviewboard/accounts/models.py. After that I wanted to update DB definition. But I had a error with this command. “manage.py evolve –hint” I got this error. “django.db.utils.DatabaseError: no such table: django_project_version” I don’t understand how to solve this error.

A: are you running this from inside the directory where manage.py is? or from the top of the source tree? it looks like it’s not seeing a populated databas you probably want to be running it like this: ./reviewboard/manage.py evolve –hint

Q: I ran “reviewboard/manage.py”

A: what happens if you run: ./reviewboard/manage.py syncdb. just to make sure, did you have your local Review Board working? and is your local instance still operating properly? If you run ./reviewboard/contrib/internal/devserver.py, and go to localhost:8080 in your browser, are things still working properly? (just ./contrib/internal/devserver.py)

Q: ”./contrib/internal/devserver.py” was working. but I’m not sure “evolve –hint” is working. I got “No evolution required.”

A: ok. So maybe the change you made is already in the database now. What you can do is: 1) make a backup of the database, 2) delete it, 3) switch back to the ‘master’ branch, 4) create a new database (./reviewboard/manage.py syncdb), then 5) switch back to your branch and try evolve –hint again

Q: I don’t know how to make a backup of the database. could you tell me?

A: sure – the database is called reviewboard.db. you simply need to copy the file. Is the evolve –hint working now?

Q: It is working and I got “Trial evolution successful.”   Thanks!

Closing Remarks

ask questions. Prepare for the meetings with questions and data.The more detailed your status report and questions, the better.
Use pastie.org or pastebin.com. And don’t wait for the meetings. ask us as soon as you’re stuck
we’re here to get you unstuck. Use us.

Advertisements

One thought on “Meeting Minutes for Group B – February 9th, 2013

  1. Pingback: Meeting Minutes for Group A – February 10th, 2013 | Review Board Student Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s