<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 18/05/15 11:35, Daniel wrote:<br>
    </div>
    <blockquote
cite="mid:CAGS+azV8Z60oNjx9BCNx6GyUXMCJS+-0KJtk8JhE49PfdLgxEQ@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">El 18 de mayo de 2015, 11:17, Juan
            Carizza <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:juan.carizza@gmail.com" target="_blank">juan.carizza@gmail.com</a>></span>
            escribió:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr"><br>
                <br>
                <div class="gmail_quote"><span class="">El dom., 17 may.
                    2015 a las 19:59, Daniel (<<a
                      moz-do-not-send="true"
                      href="mailto:dmlistapython@gmail.com"
                      target="_blank">dmlistapython@gmail.com</a>>)
                    escribió:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr">tengo estas urls
                        <div><br>
                        </div>
                        <div>router.register(r'api/articulos',
                          ArticuloViewSet)
                          <div>router.register(r'api/costos',
                            CostosViewSet)<br>
                          </div>
                          <div><br>
                          </div>
                          <div>y estas son las viewsets</div>
                          <div><br>
                          </div>
                          <div><a moz-do-not-send="true"
                              href="http://pastebin.com/VBTr2PtH"
                              target="_blank">http://pastebin.com/VBTr2PtH</a><br>
                          </div>
                          <div><br>
                          </div>
                          <div>Resulta que la URL de costos  sobrescribe
                            la de Articulo</div>
                          <div>
                            <pre style="overflow:auto;font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:12px;padding:8px;margin-top:0px;margin-bottom:10px;line-height:1.42857143;color:rgb(51,51,51);word-break:break-all;word-wrap:normal;border:1px solid rgb(225,225,232);border-radius:4px;background-color:rgb(247,247,249)"><span style="color:rgb(72,72,76)">    </span><span style="color:rgb(221,17,68)">"api/articulos"</span><span style="color:rgb(147,161,161)">:</span><span style="color:rgb(72,72,76)"> </span><span style="color:rgb(221,17,68)">"</span><a moz-do-not-send="true" href="http://127.0.0.1:8000/api/costos" rel="nofollow" style="color:rgb(163,0,0);text-decoration:none;background:0px 0px" target="_blank"><span style="color:rgb(221,17,68)">http://127.0.0.1:8000/api/costos</span></a><span style="color:rgb(221,17,68)">"</span><span style="color:rgb(147,161,161)">,</span><span style="color:rgb(72,72,76)">
</span><span style="color:rgb(72,72,76)">    </span><span style="color:rgb(221,17,68)">"api/costos"</span><span style="color:rgb(147,161,161)">:</span><span style="color:rgb(72,72,76)"> </span><span style="color:rgb(221,17,68)">"</span><a moz-do-not-send="true" href="http://127.0.0.1:8000/api/costos" rel="nofollow" style="color:rgb(163,0,0);text-decoration:none;background:0px 0px" target="_blank"><span style="color:rgb(221,17,68)">http://127.0.0.1:8000/api/costos</span></a><span style="color:rgb(221,17,68)">"</span></pre>
                          </div>
                          <div><br>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                    <div><br>
                    </div>
                  </span></div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div class="gmail_quote"><span class=""></span>
                  <div>¿Esto de dónde lo sacas? ^</div>
                </div>
              </div>
            </blockquote>
            <div>Eso me lo muestra si entro a la URL raiz (la API root)<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div class="gmail_quote"><span class="">
                    <div> </div>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr">
                        <div>
                          <div>Pero si comento la de costos la de
                            articulos se comporta bien ¿por que se
                            sobreescribe?</div>
                          <div>¿alguna pista?</div>
                        </div>
                      </div>
                    </blockquote>
                    <div><br>
                    </div>
                  </span>
                  <div>Según lo que dice la doc [0] lo que se pasa por
                    parametro el nombre del resource. "api/articulos" no
                    es un nombre de un resource por lo que debería tirar
                    error. Entonces, lo que tendrías que pasar es
                    "articulos".<br>
                    e.g:<br>
                    <br>
                  </div>
                  <div>    router.register(r'articulos',
                    ArticuloViewSet)
                    <div>
                      <div>    router.register(r'costos', CostosViewSet)<br>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>es lo mismo porque cambia la url, pero lo hice como me
              indicás y hace exactamente lo mismo<br>
            </div>
            <div>algo en el viewset de costos (que esta basado en el
              mismo model que articulos pero serializado de otra manera)
              sobrescribe articulos<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Hola, yo probaría poniendo un debugger en el viewset, fijate si está
    usando el serializador correcto, si la información serializada
    corresponde con lo que esperás, etc.<br>
    <br>
    Saludos,<br>
    --<br>
    Ariel Camino<br>
  </body>
</html>