SlideShare a Scribd company logo
1 of 71
tagging best practice
     MyBike.JP dev team
e.g.
MyBike.JP
MyBike.JP
MyBike.JP
class Tag(DateTimeModel):
    tag = models.SlugField(u'   ', unique=True, db_index=True)

class TaggedItem(DateTimeModel):
    tag = models.ForeignKey(Tag)
    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField()
    content_object = generic.GenericForeignKey('content_type', 'object_id')
Django ContentTypes
                                 Tag



polymonic                    TaggedItem



                      Bike     Component
bucho
bucho

Bucho
bucho

Bucho

BUCHO
bucho

Bucho

BUCHO
http://mybike.jp/bikes/tag/bucho
http://mybike.jp/bikes/tag/bucho


http://mybike.jp/bikes/tag/Bucho
http://mybike.jp/bikes/tag/bucho


http://mybike.jp/bikes/tag/Bucho


http://mybike.jp/bikes/tag/BUCHO
http://mybike.jp/bikes/tag/bucho


http://mybike.jp/bikes/tag/Bucho


http://mybike.jp/bikes/tag/BUCHO


http://mybike.jp/bikes/tag/
http://mybike.jp/bikes/tag/bucho


http://mybike.jp/bikes/tag/Bucho


http://mybike.jp/bikes/tag/BUCHO


http://mybike.jp/bikes/tag/



→
class Tag(DateTimeModel):
    tag = models.SlugField(u'   ', unique=True, db_index=True)

class TaggedItem(DateTimeModel):
    tag = models.ForeignKey(Tag)
    tag_label = models.CharField(max_length=100)
    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField()
    content_object = generic.GenericForeignKey('content_type', 'object_id')
class Tag(DateTimeModel):
    tag = models.SlugField(u'   ', unique=True, db_index=True)

class TaggedItem(DateTimeModel):
    tag = models.ForeignKey(Tag)
    tag_label = models.CharField(max_length=100)
    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField()
    content_object = generic.GenericForeignKey('content_type', 'object_id')
Tag.tag TaggedItem.tag_label
Tag.tag TaggedItem.tag_label


Tag.tag
Tag.tag TaggedItem.tag_label


Tag.tag
TaggedItem

  bucho

  Bucho

  BUCHO
TaggedItem

  bucho

  Bucho

  BUCHO
TaggedItem

  bucho
             Tag
  Bucho
             bucho
  BUCHO
Good
Good
Good
Good




→
Bad
Bad
Bad
Bad
Bad




→
http://mybike.jp/bikes/tag/
http://mybike.jp/bikes/tag/



                          …
RIESE&MULLER
    (             &                        )




http://mybike.jp/bikes/manufacturer/RIESE&MULLER
http://mybike.jp/bikes/manufacturer/RIESE&MULLER
http://mybike.jp/bikes/manufacturer/RIESE&MULLER
http://mybike.jp/bikes/manufacturer/RIESE&MULLER



             RISE&MULLER
http://mybike.jp/bikes/manufacturer/RIESE&MULLER



             RISE&MULLER
http://mybike.jp/bikes/manufacturer/RIESE&MULLER



             RISE&MULLER



                        …
slug regex → [-w]+
slug regex → [-w]+


reverse()
%26
→URL
%26
→URL


urls.py         &
→
urls.py


(?P<manufacturer_name>[-w]+)
urls.py


(?P<manufacturer_name>[-w]+)




(?P<manufacturer_name>[- &w]+)
templates     iriencode
→<a href=”{{ hoge|iriencode }}”>hoge</a>

urls.py     URL decode
http://mybike.jp

More Related Content

Viewers also liked

melssCRM Case Study - Control Electric Company
melssCRM Case Study - Control Electric CompanymelssCRM Case Study - Control Electric Company
melssCRM Case Study - Control Electric CompanymelssCRM
 
[UDIS_6_2nd] Data Journalism_20140712
[UDIS_6_2nd] Data Journalism_20140712[UDIS_6_2nd] Data Journalism_20140712
[UDIS_6_2nd] Data Journalism_20140712Sunghun Bae
 
e2e Projects
e2e Projectse2e Projects
e2e Projectssujite2e
 
e2e Projects
e2e Projectse2e Projects
e2e Projectssujite2e
 
Corporate presentation
Corporate presentationCorporate presentation
Corporate presentationsujite2e
 
Deployment roadmap
Deployment roadmapDeployment roadmap
Deployment roadmapsujite2e
 
Recycling council of bc
Recycling council of bcRecycling council of bc
Recycling council of bcAlex
 
Tracking social media campaigns @ editech
Tracking social media campaigns @ editechTracking social media campaigns @ editech
Tracking social media campaigns @ editechRobot Media
 

Viewers also liked (8)

melssCRM Case Study - Control Electric Company
melssCRM Case Study - Control Electric CompanymelssCRM Case Study - Control Electric Company
melssCRM Case Study - Control Electric Company
 
[UDIS_6_2nd] Data Journalism_20140712
[UDIS_6_2nd] Data Journalism_20140712[UDIS_6_2nd] Data Journalism_20140712
[UDIS_6_2nd] Data Journalism_20140712
 
e2e Projects
e2e Projectse2e Projects
e2e Projects
 
e2e Projects
e2e Projectse2e Projects
e2e Projects
 
Corporate presentation
Corporate presentationCorporate presentation
Corporate presentation
 
Deployment roadmap
Deployment roadmapDeployment roadmap
Deployment roadmap
 
Recycling council of bc
Recycling council of bcRecycling council of bc
Recycling council of bc
 
Tracking social media campaigns @ editech
Tracking social media campaigns @ editechTracking social media campaigns @ editech
Tracking social media campaigns @ editech
 

More from Mitsukuni Sato

geohexで作るロケーションヒートマップ
geohexで作るロケーションヒートマップgeohexで作るロケーションヒートマップ
geohexで作るロケーションヒートマップMitsukuni Sato
 
BPStudy #45 自転車 de ダイエット
BPStudy #45 自転車 de ダイエットBPStudy #45 自転車 de ダイエット
BPStudy #45 自転車 de ダイエットMitsukuni Sato
 
Bpstudy44 Rikuzentakata
Bpstudy44 RikuzentakataBpstudy44 Rikuzentakata
Bpstudy44 RikuzentakataMitsukuni Sato
 
BPStudy #42 MongoDB and MyBike.JP and Me
BPStudy #42  MongoDB and MyBike.JP and MeBPStudy #42  MongoDB and MyBike.JP and Me
BPStudy #42 MongoDB and MyBike.JP and MeMitsukuni Sato
 
ガラケーの識別子
ガラケーの識別子ガラケーの識別子
ガラケーの識別子Mitsukuni Sato
 

More from Mitsukuni Sato (6)

geohexで作るロケーションヒートマップ
geohexで作るロケーションヒートマップgeohexで作るロケーションヒートマップ
geohexで作るロケーションヒートマップ
 
BPStudy #45 自転車 de ダイエット
BPStudy #45 自転車 de ダイエットBPStudy #45 自転車 de ダイエット
BPStudy #45 自転車 de ダイエット
 
Bpstudy44 Rikuzentakata
Bpstudy44 RikuzentakataBpstudy44 Rikuzentakata
Bpstudy44 Rikuzentakata
 
BPStudy #42 MongoDB and MyBike.JP and Me
BPStudy #42  MongoDB and MyBike.JP and MeBPStudy #42  MongoDB and MyBike.JP and Me
BPStudy #42 MongoDB and MyBike.JP and Me
 
ガラケーの識別子
ガラケーの識別子ガラケーの識別子
ガラケーの識別子
 
負荷分散の話
負荷分散の話負荷分散の話
負荷分散の話
 

Recently uploaded

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Tagging architecture on MyBike.JP

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n