#4102: Allow UPDATE of only specific fields in model.save()
-------------------------------------+-------------------------------------
Reporter: Collin Grady | Owner: cgrady
<cgrady@…> | Status: new
Type: New feature | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: update fields sql | Patch needs improvement: 1
row table modified | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by akaariai):
I will take this ticket from here.
We don't have any official guidelines on how to work on github, but here
is an approach I like.
{{{
# Assume you have django/django as "upstream" remote in your local git
repo.
# (if not: git add remote upstream [email protected]:django/django.git)
# Start work on ticket.
# Work in ticket_4102, make it track upstream/master branch.
git checkout -b ticket_4102 upstream/master
# do some commits:
git add files
git commit -m 'A commit message...'
# check for whitespace errors
git diff --check upstream/master
# Spot some errors, correct files and commit
git add files
git commit -m 'DOH! whitespace error!'
# The above commit should not go into Django's repository, so squash it
# (HEAD~2 refers to last two commits on this branch)
git rebase -i HEAD~2
# pick the original commit ("A commit message..."), squash (s as first
char on line) the "DOH!" commit.
# reword commit messages, usually keep the first message as is, drop the
second message.
# Run (relevant) tests!
# ok, seems the work is ready, push it to your github repo (assumed to be
origin here)
git push origin ticket_4102
# make a pull request in github.
# An annoying core-developer spots a world-ending issue (another
whitespace error).
# And, there have been some commits to the django/django repo too, so you
need to update your patch to head.
# In your local branch ticket_4102 rebase your work to current upstream
master
git fetch upstream
git rebase
# If conflicts above, correct & continue.
# correct & commit the whitespace error, repeat the rebase -i step above
# Run (relevant) tests!
# Now, push again to origin. You have rebased your work. This changes the
commit
# history, and those who based their work on your work will hate you (they
need to
# rebase their work, too). However, this does not matter, as your branch
is a
# "topic branch" and nobody should trust your branch to be stable in
commit history.
# So force push changes:
git push --force origin ticket_4102
# You have your work in a single corrected commit in the original pull
request!
}}}
The above isn't tested.
Commit message guidelines (in short): A summary line of 50 chars.
Separated with an empty line, paragraphs of 70 chars per line detailing
the commit. Limits are soft, so if need be, break the characters per line
rules.
A single commit always? No, separate your work into logical "blocks". For
this ticket, there is just one logical block, so a single commit.
If the above seems confusing or a lot of work to do, here is another
approach: At some point hand over your work to a committer who will finish
it off.
As said, the above isn't official Django workflow, just my approach...
--
Ticket URL: <https://code.djangoproject.com/ticket/4102#comment:92>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.