Services
Blog
Français
Extract from a great thread on the django-developper mailing list started by Trey Raymond:
I’m a DB engineer working for Yahoo, and we have a new product using django that I’m onboarding. We see a variety of easily fixed issues, but one major one - there are 21 many-many tables here, yet they have auto increment primary keys
-- Example, existing:
CREATE TABLE `accounts_profile_starred_groups` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`group_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `profile_id` (`profile_id`,`group_id`),
KEY `group_id_refs_id_e2f1545` (`group_id`)
) ENGINE=InnoDB;
-- Fixed:
CREATE TABLE `accounts_profile_starred_groups` (
`profile_id` int(10) unsigned NOT NULL,
`group_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`profile_id`,`group_id`),
KEY `group_id_refs_id_e2f1545` (`group_id`)
) ENGINE=InnoDB;
Looking forward to see how it goes !
Read MoreSounds pretty cool if you ask me. Check out this fine free DNS management service.
Here’s a really cool contribution. Harry Percival emailed django-developers about his employer, PythonAnywhere:
We do offer Django hosting as part of our Free plan, so it’s a nice place for people to come and try out Django, for free, maybe host a prototype web app…
I registered to give it a tried and received an amazing welcome email, which I won’t spoil for you !
This is the second article about reversing urls in javascript. The previous article actually presented a bad idea.
Github’s API is undubitably quite suprising for a web developer that isn’t aware of the HATEOAS concept, here’s the kind of things you can see for example:
[
{
"updated_at": "2012-11-27T14:42:24Z",
"svn_url": "https://github.com/yourlabs/django-cities-light",
"language": "Python",
"milestones_url": "https://api.github.com/repos/yourlabs/django-cities-light/milestones{/number}",
"downloads_url": "https://api.github.com/repos/yourlabs/django-cities-light/downloads",
"subscription_url": "https://api.github.com/repos/yourlabs/django-cities-light/subscription",
"teams_url": "https://api.github.com/repos/yourlabs/django-cities-light/teams",
"full_name": "yourlabs/django-cities-light",
"git_url": "git://github.com/yourlabs/django-cities-light.git",
"git_tags_url": "https://api.github.com/repos/yourlabs/django-cities-light/git/tags{/sha}",
"owner": {
"login": "yourlabs",
"organizations_url": "https://api.github.com/users/yourlabs/orgs",
"followers_url": "https://api.github.com/users/yourlabs/followers",
"starred_url": "https://api.github.com/users/yourlabs/starred{/owner}{/repo}",
"following_url": "https://api.github.com/users/yourlabs/following",
"avatar_url": "https://secure.gravatar.com/avatar/c0efe8e5c15bd268224fbc40a574329d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
"repos_url": "https://api.github.com/users/yourlabs/repos",
"subscriptions_url": "https://api.github.com/users/yourlabs/subscriptions",
"url": "https://api.github.com/users/yourlabs",
"events_url": "https://api.github.com/users/yourlabs/events{/privacy}",
"gravatar_id": "c0efe8e5c15bd268224fbc40a574329d",
"received_events_url": "https://api.github.com/users/yourlabs/received_events",
"id": 1040547,
"gists_url": "https://api.github.com/users/yourlabs/gists{/gist_id}"
},
Wow, so many URLs… At first, this may look original, if not excentric. Why aren’t they just documented ?
Read MoreKeeping your inbox clean can be quite a pain. Except with keyboard shortcuts.
? shows the list of shortcuts,/ to search mails,c to compose a message,gi brings you to the inbox,j and k moves the little blue cursor between threads,x selects the thread that has the blue cursor,e archives selected threads,o opens selected threada is for reply to all,r is for reply.That’s it !
IMPORTANT UPDATE: the approach proposed in this article is bad. Read this one instead.
You can start building a user interface using Django’s awesome CRUD in a matter of seconds, for example with just this server side configuration:
url(delete/(?P<pk>\d+)/$',
generic.DeleteView.as_view(model=YourModel),
name='yourapp_yourmodel_delete'),http://www.w3.org/TR/html-markup/syntax.html#syntax-attr-unquoted
Stuff like this: Can now be: That should save some bits !
http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-showmodaldialog
This specification of HTML5 provides an API for modal dialogs, we will not need a plugin anymore. This blog will present a cool HTML5 feature every now and then.
The previously announced backward compatibility break, although minor, has been released.
So don’t do pip update -U django-autocomplete-light unless you’re ready to change to in your autocomplete_light templates overrides (actually, that might not even be necessary now that I think of it).
You’ve been warned !
In the next week(s), django-autocomplete-light v 1.1.0 will succeed to v1.0.26. It will include commit 2c756a may be short but it will break your custom Autocomplete classes that generate custom HTML and custom django-autocomplete_light templates.
To upgrade to 1.1.0, please replace all <div> by <span> with class div in your custom Autocomplete classes and autocomplete_light templates. If you have any, examples can be seen in commit d50fd which fixes some tests (thanks continuous integration provided travis !).