twoscoops / two-scoops-of-django-1.8

Tracking thoughts and feature requests for Two Scoops of Django 1.8 in the issue tracker. And the book's code examples are here.
400 stars 81 forks source link

Suggestion: GenericForeignKey usage #22

Closed kracekumar closed 9 years ago

kracekumar commented 9 years ago

Django has ContentType which comes in handy when GenericForeignKey is used. GenericForeignKey is usable when ForeignKey is spread across multiple models. This in turn become pain when unexpected Model is referenced.

Discussing when to use them, how to handle unexpected cases and when to avoid is good topic.

pydanny commented 9 years ago

I believe somewhere in the books we already recommend strongly against using GenericForeignKeys. If not, we'll add it in.

kracekumar commented 9 years ago

Awesome! My bad memory, Apologies.

On Tue, Apr 21, 2015 at 2:46 PM, Daniel Greenfeld notifications@github.com wrote:

I believe somewhere in the books we already recommend strongly against using GenericForeignKeys. If not, we'll add it in.

— Reply to this email directly or view it on GitHub https://github.com/twoscoops/two-scoops-of-django-1.8/issues/22#issuecomment-94716334 .

Regards Kracekumar Ramaraju http://kracekumar.com +91 85530 29521

0x0c72 commented 9 years ago

I’m not sure I made this specific suggestion. I do have a question though, something I would like to see in the next book. More in depth into creating/consuming REST API’s. Creating/consuming SOAP transactions. And a chapter or two on using Django with js frameworks like bootstrap and angular. And about a chapter on tools, I know you have one, but some more in depth on usage, tools like bower, gulp, grunt, and CSS preprocessors like SCSS. A chapter on web servers would help a lot too. Such as gunicorn with nginx reverse proxy, apache with mod_wsgi, and others. They are mentioned but just a bit more in depth with examples and some gotchas and such. If you could include the best practices for all of these with examples. Gotchas, and informations then this would be the best programming book ever. Although it already sort of is ☺

Take Care, can’t wait for 1.8 book

P.S. the 1.8 book comes out in april? April is almost over. I just bought the 1.6 book and found out that 1.8 comes out this month ;( I’ll still buy it though. When will it actually be available on amazon or wherever?

Chris Shenkan Project Manager Tel: 215-428-9537 Fax: 215-428-9580 Email: cshenkan@shenkan-associates.commailto:cshenkan@shenkan-associates.com [Description: Description: S&ARedFull]

From: Daniel Greenfeld [mailto:notifications@github.com] Sent: Tuesday, April 21, 2015 5:17 AM To: twoscoops/two-scoops-of-django-1.8 Subject: Re: [two-scoops-of-django-1.8] Suggestion: GenericForeignKey usage (#22)

I believe somewhere in the books we already recommend strongly against using GenericForeignKeys. If not, we'll add it in.

— Reply to this email directly or view it on GitHubhttps://github.com/twoscoops/two-scoops-of-django-1.8/issues/22#issuecomment-94716334.

pydanny commented 9 years ago

@shenkan A few questions:

  1. Did you meant to respond to this GitHub issue as if it were an email? FWIW, I really appreciate when people use GitHub over email to contact me about the book and Django issues. On average I'm getting 5-20 emails per day about Two Scoops of Django, and I'm a month behind. Asking questions here on GitHub (or Twitter) is the fastest way to get answers.
  2. Rather than ask your questions in an unrelated issue (which is about GenericForeignKeys), could you break them up as individual ones using https://github.com/twoscoops/two-scoops-of-django-1.8/issues/new?
pydanny commented 9 years ago

@kracekumar Turns out your memory is correct. We don't put proper hate on the subject of GenericForeignKeys.

0x0c72 commented 9 years ago

Yes emailed. Will reply on github form now on. I didn't get to pick the issue so sorry for being off topic.

pydanny commented 9 years ago

:ship: