SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Initial Presentation
 February 25, 2010
Progress

 UI
   Finished Wireframes
   Created Mockups
   Decided on a color schemes
   Icon Set is going through revisions
   UI Implementation - translate Photoshop mockup to CSS
   HTML structure & Django templates
 REST API
   Manipulate Tags
   Manipulate Audio Objects



                                            Details on our wiki[1]
Mockup




         See our blog post on waveform behavior[2]
Representational State Transfer
(REST) API



    Interface for manipulating resources over HTTP
REST HTTP methods


          Resource                             GET                      PUT                         POST                    DELETE



                                                             Replace the entire
 Collection URI, such as             List the collection's                                  Create a new entry in    Delete the entire
                                                             collection with another
   http://example.com/resources/     members.                                               the collection.          collection.
                                                             collection.




                                                             Replace the addressed          Treat the addressed
                                     Retrieve addressed                                                              Delete the addressed
  Element URI, such as                                       member of the                  member as a collection
                                     member of the                                                                   member of the
 http://example.com/resources/142/                           collection, or if it doesn't   and create a new entry
                                     collection.                                                                     collection.
                                                             exist,create it.               in it.
REST HTTP methods


          Resource                             GET                      PUT                         POST                    DELETE



                                                             Replace the entire
 Collection URI, such as             List the collection's                                  Create a new entry in    Delete the entire
                                                             collection with another
   http://example.com/resources/     members.                                               the collection.          collection.
                                                             collection.




                                                             Replace the addressed          Treat the addressed
                                     Retrieve addressed                                                              Delete the addressed
  Element URI, such as                                       member of the                  member as a collection
                                     member of the                                                                   member of the
 http://example.com/resources/142/                           collection, or if it doesn't   and create a new entry
                                     collection.                                                                     collection.
                                                             exist,create it.               in it.
REST HTTP methods


          Resource                             GET                      PUT                         POST                    DELETE



                                                             Replace the entire
 Collection URI, such as             List the collection's                                  Create a new entry in    Delete the entire
                                                             collection with another
   http://example.com/resources/     members.                                               the collection.          collection.
                                                             collection.




                                                             Replace the addressed          Treat the addressed
                                     Retrieve addressed                                                              Delete the addressed
  Element URI, such as                                       member of the                  member as a collection
                                     member of the                                                                   member of the
 http://example.com/resources/142/                           collection, or if it doesn't   and create a new entry
                                     collection.                                                                     collection.
                                                             exist,create it.               in it.
REST in Concert
    Easily modify Django models from the frontend




                                          See our previous presentation on
                                          Backbone.js[3]
But what does it all mean?
                  POST http://localhost:8896/api/1/request/
                    {"collection":"/api/1/collection/1/", "user":"/api/1/user/2/"}




   { "collection": "/api/1/collection/1/", "id": "1", "resource_uri":
   "/api/1/request/1/", "status": "p", "user": "/api/1/user/2/" }
But what does it all mean?
                  GET http://localhost:8896/api/1/request/


   [ { "collection": "/api/1/collection/1/", "id": "1", "resource_uri":
   "/api/1/request/1/", "status": "p", "user": "/api/1/user/2/" } ]
How we do it.
###
# A collection join request. Should be deleted when action is taken.
###
class Request(models.Model):
   ...
   user = models.ForeignKey(User)
   collection = models.ForeignKey(Collection)
   status = models.CharField(max_length=1, choices=REQUEST_STATUS_CHOICES, default='p')
   ...
How we do it.
###
# A collection join request. Should be deleted when action is taken.
###
class Request(models.Model):
   ...
   user = models.ForeignKey(User)
   collection = models.ForeignKey(Collection)
   status = models.CharField(max_length=1, choices=REQUEST_STATUS_CHOICES, default='p')
   ...



                           tastypie
                       ###
                       # This is the resource that is used for a collection request.
                       ###
                       class RequestResource(MyResource):
                          user = fields.ForeignKey(UserResource, 'user')
                          collection = fields.ForeignKey(CollectionResource, 'collection', full=True)
                          status = fields.CharField('status', default='p')
                          ...
How we do it.
###
# A collection join request. Should be deleted when action is taken.
###
class Request(models.Model):
   ...
   user = models.ForeignKey(User)
   collection = models.ForeignKey(Collection)
   status = models.CharField(max_length=1, choices=REQUEST_STATUS_CHOICES, default='p')
   ...



                           tastypie
                       ###
                       # This is the resource that is used for a collection request.
                       ###
                       class RequestResource(MyResource):
                          user = fields.ForeignKey(UserResource, 'user')
                          collection = fields.ForeignKey(CollectionResource, 'collection', full=True)
                          status = fields.CharField('status', default='p')
                          ...



                                                                                                        /**
                                                                                                         * A Collection object represents a django Collection object.
                                                                                                         * @class
                                                                                                         **/
                                                                                                        var Collection = ConcertBackboneModel.extend({
                                                                                                           ...
                                                                                                           /**
                                                                                                            * When a user wants to join a collection.
                                                                                                            **/
                                                                                                           requestToJoin: function() {
                                                                                                               var reqs = this.get('requests');
                                                                                                               reqs.create({
                                                                                                                  user: com.concertsoundorganizer.page.user.url(),
                                                                                                                  collection: this.url()
                                                                                                               });
                                                                                                           }
                                                                                                           ...
How we do it.
###
# A collection join request. Should be deleted when action is taken.
###
class Request(models.Model):
   ...
   user = models.ForeignKey(User)
   collection = models.ForeignKey(Collection)
   status = models.CharField(max_length=1, choices=REQUEST_STATUS_CHOICES, default='p')
   ...



                            tastypie
                       ###
                       # This is the resource that is used for a collection request.
                       ###
                       class RequestResource(MyResource):
                          user = fields.ForeignKey(UserResource, 'user')
                          collection = fields.ForeignKey(CollectionResource, 'collection', full=True)
                          status = fields.CharField('status', default='p')
                          ...



                                                                                                        /**
                                                                                                         * A Collection object represents a django Collection object.
                                                                                                         * @class
                                                                                                         **/
                                                                                                        var Collection = ConcertBackboneModel.extend({
                                                                                                           ...
                                                                                                           /**
                                                                                                            * When a user wants to join a collection.
                                                                                                            **/
                                                                                                           requestToJoin: function() {
                                                                                                               var reqs = this.get('requests');
                                                                                                               reqs.create({
                                                                                                                  user: com.concertsoundorganizer.page.user.url(),
                    POST http://localhost:8896/api/1/request/                                                     collection: this.url()
                    {"collection":"/api/1/collection/1/", "user":"/api/1/user/2/"}                             });
                                                                                                           }
                                                                                                           ...
Issues


               Concert Events

                     &

         Many-To-Many Relationships
Issues
class Tag(models.Model):
   segments = models.ManyToManyField('AudioSegment', related_name = "tags")
   collection = models.ForeignKey('Collection')
   name = models.CharField(max_length = 100)
   time = models.DateTimeField(auto_now_add = True)
   creator = models.ForeignKey(User)




                                                     Old Way
                                              Add URL: /add_segment_to_tag

                                           Delete URL: /delete_segment_from_tag
Issues
class Tag(models.Model):
   segments = models.ManyToManyField('AudioSegment', related_name = "tags")
   collection = models.ForeignKey('Collection')
   name = models.CharField(max_length = 100)
   time = models.DateTimeField(auto_now_add = True)
   creator = models.ForeignKey(User)




                                                     New Way

  Client send a PUT Request                         /api/tag/<tag_id>/        Backend UPDATES the tag
  (Wants to add an audio segment to a given tag)
                                                                              object instance
                                                                              (HOW AND WHAT DID IT UPDATE?)
Solution



           Custom Nested
             Resources
Solution

           /api/tag/<tag_id>
Solution

                     /api/tag/<tag_id>



       /api/tag/<tag_id>/audio_segment/<audio_seg_id>
Thanks & Questions
Especially to Graylin...

Weitere ähnliche Inhalte

Was ist angesagt?

Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?Yevhen Kotelnytskyi
 
Как получить чёрный пояс по WordPress? v2.0
Как получить чёрный пояс по WordPress? v2.0Как получить чёрный пояс по WordPress? v2.0
Как получить чёрный пояс по WordPress? v2.0Yevhen Kotelnytskyi
 
Intro to Joomla Development
Intro to Joomla DevelopmentIntro to Joomla Development
Intro to Joomla DevelopmentAlex Andreae
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3giwoolee
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Kris Wallsmith
 

Was ist angesagt? (6)

Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?
 
Как получить чёрный пояс по WordPress? v2.0
Как получить чёрный пояс по WordPress? v2.0Как получить чёрный пояс по WordPress? v2.0
Как получить чёрный пояс по WordPress? v2.0
 
Intro to Joomla Development
Intro to Joomla DevelopmentIntro to Joomla Development
Intro to Joomla Development
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
 

Andere mochten auch

ReliefWeb | DevSeed Meeting | 03 Sep 2010
ReliefWeb | DevSeed Meeting | 03 Sep 2010ReliefWeb | DevSeed Meeting | 03 Sep 2010
ReliefWeb | DevSeed Meeting | 03 Sep 2010ReliefWeb
 
ReliefWeb Strategic Business Plan
ReliefWeb Strategic Business PlanReliefWeb Strategic Business Plan
ReliefWeb Strategic Business PlanReliefWeb
 
Relief: 2nd Round Mockups
Relief: 2nd Round MockupsRelief: 2nd Round Mockups
Relief: 2nd Round MockupsReliefWeb
 
Illustration in Advertising
Illustration in AdvertisingIllustration in Advertising
Illustration in AdvertisingSumo
 
Museum Branding from Sumo
Museum Branding from SumoMuseum Branding from Sumo
Museum Branding from SumoSumo
 
Making your brand social
Making your brand socialMaking your brand social
Making your brand socialSumo
 
Crowdsourcing Democracy
Crowdsourcing DemocracyCrowdsourcing Democracy
Crowdsourcing DemocracySumo
 
Style Guides Are The New Photoshop (Fronteers 2012)
Style Guides Are The New Photoshop (Fronteers 2012)Style Guides Are The New Photoshop (Fronteers 2012)
Style Guides Are The New Photoshop (Fronteers 2012)Stephen Hay
 
Illustration from Sumo
Illustration from SumoIllustration from Sumo
Illustration from SumoSumo
 

Andere mochten auch (10)

ReliefWeb | DevSeed Meeting | 03 Sep 2010
ReliefWeb | DevSeed Meeting | 03 Sep 2010ReliefWeb | DevSeed Meeting | 03 Sep 2010
ReliefWeb | DevSeed Meeting | 03 Sep 2010
 
ReliefWeb Strategic Business Plan
ReliefWeb Strategic Business PlanReliefWeb Strategic Business Plan
ReliefWeb Strategic Business Plan
 
Relief: 2nd Round Mockups
Relief: 2nd Round MockupsRelief: 2nd Round Mockups
Relief: 2nd Round Mockups
 
Illustration in Advertising
Illustration in AdvertisingIllustration in Advertising
Illustration in Advertising
 
dirty mockups
dirty mockupsdirty mockups
dirty mockups
 
Museum Branding from Sumo
Museum Branding from SumoMuseum Branding from Sumo
Museum Branding from Sumo
 
Making your brand social
Making your brand socialMaking your brand social
Making your brand social
 
Crowdsourcing Democracy
Crowdsourcing DemocracyCrowdsourcing Democracy
Crowdsourcing Democracy
 
Style Guides Are The New Photoshop (Fronteers 2012)
Style Guides Are The New Photoshop (Fronteers 2012)Style Guides Are The New Photoshop (Fronteers 2012)
Style Guides Are The New Photoshop (Fronteers 2012)
 
Illustration from Sumo
Illustration from SumoIllustration from Sumo
Illustration from Sumo
 

Mehr von mskmoorthy

Crowdsourcing for geoint-11.11.11
Crowdsourcing for geoint-11.11.11Crowdsourcing for geoint-11.11.11
Crowdsourcing for geoint-11.11.11mskmoorthy
 
Shuttle trackersecondpresentationfall2011
Shuttle trackersecondpresentationfall2011Shuttle trackersecondpresentationfall2011
Shuttle trackersecondpresentationfall2011mskmoorthy
 
Mobile shuttle tracker_fall_2011_first_present
Mobile shuttle tracker_fall_2011_first_presentMobile shuttle tracker_fall_2011_first_present
Mobile shuttle tracker_fall_2011_first_presentmskmoorthy
 
Rcos presentation 9-23-2011
Rcos presentation 9-23-2011Rcos presentation 9-23-2011
Rcos presentation 9-23-2011mskmoorthy
 
Rcos presentation
Rcos presentationRcos presentation
Rcos presentationmskmoorthy
 
Dynamorio rpioss-aug2011
Dynamorio rpioss-aug2011Dynamorio rpioss-aug2011
Dynamorio rpioss-aug2011mskmoorthy
 
Auto scheduler presentation_2
Auto scheduler presentation_2Auto scheduler presentation_2
Auto scheduler presentation_2mskmoorthy
 
Second presentation idea_bank
Second presentation idea_bankSecond presentation idea_bank
Second presentation idea_bankmskmoorthy
 
Rpi planner geoffrey_wright_7-22-2011
Rpi planner geoffrey_wright_7-22-2011Rpi planner geoffrey_wright_7-22-2011
Rpi planner geoffrey_wright_7-22-2011mskmoorthy
 
Sean austin uir-2
Sean austin uir-2Sean austin uir-2
Sean austin uir-2mskmoorthy
 
Nexus2 7-22-1011
Nexus2 7-22-1011Nexus2 7-22-1011
Nexus2 7-22-1011mskmoorthy
 
Rpi planner geoffrey_wright_7-22-2011
Rpi planner geoffrey_wright_7-22-2011Rpi planner geoffrey_wright_7-22-2011
Rpi planner geoffrey_wright_7-22-2011mskmoorthy
 
Flagship safety, hfoss-7-22-2011
Flagship safety, hfoss-7-22-2011Flagship safety, hfoss-7-22-2011
Flagship safety, hfoss-7-22-2011mskmoorthy
 
Olympus pesentation2
Olympus pesentation2Olympus pesentation2
Olympus pesentation2mskmoorthy
 
Observatory 7 15-11
Observatory 7 15-11Observatory 7 15-11
Observatory 7 15-11mskmoorthy
 
Concerto conmoto
Concerto conmotoConcerto conmoto
Concerto conmotomskmoorthy
 

Mehr von mskmoorthy (20)

Crowdsourcing for geoint-11.11.11
Crowdsourcing for geoint-11.11.11Crowdsourcing for geoint-11.11.11
Crowdsourcing for geoint-11.11.11
 
Shuttle trackersecondpresentationfall2011
Shuttle trackersecondpresentationfall2011Shuttle trackersecondpresentationfall2011
Shuttle trackersecondpresentationfall2011
 
Rcos intro-2
Rcos intro-2Rcos intro-2
Rcos intro-2
 
Mobile shuttle tracker_fall_2011_first_present
Mobile shuttle tracker_fall_2011_first_presentMobile shuttle tracker_fall_2011_first_present
Mobile shuttle tracker_fall_2011_first_present
 
Rcos presentation 9-23-2011
Rcos presentation 9-23-2011Rcos presentation 9-23-2011
Rcos presentation 9-23-2011
 
Rcos presentation
Rcos presentationRcos presentation
Rcos presentation
 
Dynamorio rpioss-aug2011
Dynamorio rpioss-aug2011Dynamorio rpioss-aug2011
Dynamorio rpioss-aug2011
 
Auto scheduler presentation_2
Auto scheduler presentation_2Auto scheduler presentation_2
Auto scheduler presentation_2
 
Second presentation idea_bank
Second presentation idea_bankSecond presentation idea_bank
Second presentation idea_bank
 
Scrutiny 2
Scrutiny 2Scrutiny 2
Scrutiny 2
 
Rpi planner geoffrey_wright_7-22-2011
Rpi planner geoffrey_wright_7-22-2011Rpi planner geoffrey_wright_7-22-2011
Rpi planner geoffrey_wright_7-22-2011
 
Sean austin uir-2
Sean austin uir-2Sean austin uir-2
Sean austin uir-2
 
Nexus2 7-22-1011
Nexus2 7-22-1011Nexus2 7-22-1011
Nexus2 7-22-1011
 
Rpi planner geoffrey_wright_7-22-2011
Rpi planner geoffrey_wright_7-22-2011Rpi planner geoffrey_wright_7-22-2011
Rpi planner geoffrey_wright_7-22-2011
 
Flagship safety, hfoss-7-22-2011
Flagship safety, hfoss-7-22-2011Flagship safety, hfoss-7-22-2011
Flagship safety, hfoss-7-22-2011
 
Olympus pesentation2
Olympus pesentation2Olympus pesentation2
Olympus pesentation2
 
Observatory 7 15-11
Observatory 7 15-11Observatory 7 15-11
Observatory 7 15-11
 
8.7.2011 agml
8.7.2011 agml8.7.2011 agml
8.7.2011 agml
 
Concerto conmoto
Concerto conmotoConcerto conmoto
Concerto conmoto
 
Koala pres1
Koala pres1Koala pres1
Koala pres1
 

Kürzlich hochgeladen

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 

Kürzlich hochgeladen (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 

Concert spring 2011_presentation_1

  • 2. Progress UI Finished Wireframes Created Mockups Decided on a color schemes Icon Set is going through revisions UI Implementation - translate Photoshop mockup to CSS HTML structure & Django templates REST API Manipulate Tags Manipulate Audio Objects Details on our wiki[1]
  • 3. Mockup See our blog post on waveform behavior[2]
  • 4. Representational State Transfer (REST) API Interface for manipulating resources over HTTP
  • 5. REST HTTP methods Resource GET PUT POST DELETE Replace the entire Collection URI, such as List the collection's Create a new entry in Delete the entire collection with another http://example.com/resources/ members. the collection. collection. collection. Replace the addressed Treat the addressed Retrieve addressed Delete the addressed Element URI, such as member of the member as a collection member of the member of the http://example.com/resources/142/ collection, or if it doesn't and create a new entry collection. collection. exist,create it. in it.
  • 6. REST HTTP methods Resource GET PUT POST DELETE Replace the entire Collection URI, such as List the collection's Create a new entry in Delete the entire collection with another http://example.com/resources/ members. the collection. collection. collection. Replace the addressed Treat the addressed Retrieve addressed Delete the addressed Element URI, such as member of the member as a collection member of the member of the http://example.com/resources/142/ collection, or if it doesn't and create a new entry collection. collection. exist,create it. in it.
  • 7. REST HTTP methods Resource GET PUT POST DELETE Replace the entire Collection URI, such as List the collection's Create a new entry in Delete the entire collection with another http://example.com/resources/ members. the collection. collection. collection. Replace the addressed Treat the addressed Retrieve addressed Delete the addressed Element URI, such as member of the member as a collection member of the member of the http://example.com/resources/142/ collection, or if it doesn't and create a new entry collection. collection. exist,create it. in it.
  • 8. REST in Concert Easily modify Django models from the frontend See our previous presentation on Backbone.js[3]
  • 9. But what does it all mean? POST http://localhost:8896/api/1/request/ {"collection":"/api/1/collection/1/", "user":"/api/1/user/2/"} { "collection": "/api/1/collection/1/", "id": "1", "resource_uri": "/api/1/request/1/", "status": "p", "user": "/api/1/user/2/" }
  • 10. But what does it all mean? GET http://localhost:8896/api/1/request/ [ { "collection": "/api/1/collection/1/", "id": "1", "resource_uri": "/api/1/request/1/", "status": "p", "user": "/api/1/user/2/" } ]
  • 11. How we do it. ### # A collection join request. Should be deleted when action is taken. ### class Request(models.Model): ... user = models.ForeignKey(User) collection = models.ForeignKey(Collection) status = models.CharField(max_length=1, choices=REQUEST_STATUS_CHOICES, default='p') ...
  • 12. How we do it. ### # A collection join request. Should be deleted when action is taken. ### class Request(models.Model): ... user = models.ForeignKey(User) collection = models.ForeignKey(Collection) status = models.CharField(max_length=1, choices=REQUEST_STATUS_CHOICES, default='p') ... tastypie ### # This is the resource that is used for a collection request. ### class RequestResource(MyResource): user = fields.ForeignKey(UserResource, 'user') collection = fields.ForeignKey(CollectionResource, 'collection', full=True) status = fields.CharField('status', default='p') ...
  • 13. How we do it. ### # A collection join request. Should be deleted when action is taken. ### class Request(models.Model): ... user = models.ForeignKey(User) collection = models.ForeignKey(Collection) status = models.CharField(max_length=1, choices=REQUEST_STATUS_CHOICES, default='p') ... tastypie ### # This is the resource that is used for a collection request. ### class RequestResource(MyResource): user = fields.ForeignKey(UserResource, 'user') collection = fields.ForeignKey(CollectionResource, 'collection', full=True) status = fields.CharField('status', default='p') ... /** * A Collection object represents a django Collection object. * @class **/ var Collection = ConcertBackboneModel.extend({ ... /** * When a user wants to join a collection. **/ requestToJoin: function() { var reqs = this.get('requests'); reqs.create({ user: com.concertsoundorganizer.page.user.url(), collection: this.url() }); } ...
  • 14. How we do it. ### # A collection join request. Should be deleted when action is taken. ### class Request(models.Model): ... user = models.ForeignKey(User) collection = models.ForeignKey(Collection) status = models.CharField(max_length=1, choices=REQUEST_STATUS_CHOICES, default='p') ... tastypie ### # This is the resource that is used for a collection request. ### class RequestResource(MyResource): user = fields.ForeignKey(UserResource, 'user') collection = fields.ForeignKey(CollectionResource, 'collection', full=True) status = fields.CharField('status', default='p') ... /** * A Collection object represents a django Collection object. * @class **/ var Collection = ConcertBackboneModel.extend({ ... /** * When a user wants to join a collection. **/ requestToJoin: function() { var reqs = this.get('requests'); reqs.create({ user: com.concertsoundorganizer.page.user.url(), POST http://localhost:8896/api/1/request/ collection: this.url() {"collection":"/api/1/collection/1/", "user":"/api/1/user/2/"} }); } ...
  • 15. Issues Concert Events & Many-To-Many Relationships
  • 16. Issues class Tag(models.Model): segments = models.ManyToManyField('AudioSegment', related_name = "tags") collection = models.ForeignKey('Collection') name = models.CharField(max_length = 100) time = models.DateTimeField(auto_now_add = True) creator = models.ForeignKey(User) Old Way Add URL: /add_segment_to_tag Delete URL: /delete_segment_from_tag
  • 17. Issues class Tag(models.Model): segments = models.ManyToManyField('AudioSegment', related_name = "tags") collection = models.ForeignKey('Collection') name = models.CharField(max_length = 100) time = models.DateTimeField(auto_now_add = True) creator = models.ForeignKey(User) New Way Client send a PUT Request /api/tag/<tag_id>/ Backend UPDATES the tag (Wants to add an audio segment to a given tag) object instance (HOW AND WHAT DID IT UPDATE?)
  • 18. Solution Custom Nested Resources
  • 19. Solution /api/tag/<tag_id>
  • 20. Solution /api/tag/<tag_id> /api/tag/<tag_id>/audio_segment/<audio_seg_id>