|
Auteur | Sujet : blabla@django |
---|
nraynaud lol | Reprise du message précédent :
Message cité 1 fois Message édité par nraynaud le 09-06-2011 à 17:21:29 --------------- trainoo.com, c'est fini |
![]() Publicité | Posté le 09-06-2011 à 17:20:48 ![]() ![]() |
0x90 → |
--------------- Me: Django Localization, Yogo Puzzle, Chrome Grapher, C++ Signals, Brainf*ck. |
masklinn í dag viðrar vel til loftárása |
En Python 2, un binding peut être de 3 types: local, global ou closure. Si tu as une quelconque assignation (a = b) dans ta fonction, avec ton binding en LHS, ce binding devient local. Sauf si tu as une déclaration global a dans la fonction/scope, dans ce cas il va modifier le binding global. Ça veut dire qu'une closure n'est pas r/w en Python 2, just read. En Python 3, ils ont pas fixé le binding, ils ont ajouté la déclaration nonlocal a pour indiquer que c'est une closure. Ici, tu assignes une valeur à current_extent (ligne 4), donc Python infère que c'est une variable locale, et `current_extent` pête parce que la locale n'existe pas encore en scope. Je suggère ces modifs:
Tu peux aussi dégager le test explicite par une utilisation judicieuse de .get:
Message cité 1 fois Message édité par masklinn le 10-06-2011 à 09:09:17 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
nraynaud lol |
--------------- trainoo.com, c'est fini |
SekYo | Tu le veux en quelle taille ton débarquement ? La 1.3 c'était fin mars |
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
Shinuza This is unexecpected | ./manage collectstatic
--------------- Mains power can kill, and it will hurt the entire time you’re dying from it. |
nraynaud lol | Shinu> c'est le compress de quelle appli ? --------------- trainoo.com, c'est fini |
![]() Publicité | Posté le 15-06-2011 à 11:12:57 ![]() ![]() |
nraynaud lol | hum ok, j'ai utilisé un autre truc qui s'appelle http://code.google.com/p/django-compress/
--------------- trainoo.com, c'est fini |
Shinuza This is unexecpected |
--------------- Mains power can kill, and it will hurt the entire time you’re dying from it. |
nraynaud lol |
--------------- trainoo.com, c'est fini |
SekYo | nraynaud > C'est un peu le truc chiant avec les applis django, faut faire gaffe aux dates de dernières MAJ, nombre d'users, etc...
|
Remigio Radio Flip, 72.8 | Hello,
--------------- Everybody can succeed, all you need is to believe |
masklinn í dag viðrar vel til loftárása |
Genre
Message édité par masklinn le 17-06-2011 à 10:00:24 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
Remigio Radio Flip, 72.8 | Ah ! ptain c'est ça que je cherchais. Je savais bien que l'avais vu un truc du genre. Merci bien --------------- Everybody can succeed, all you need is to believe |
Remigio Radio Flip, 72.8 | Bon, on ne peut pas faire un Monmodel.objects.extra(select={'mon_champ':'toto'}).aggregate(Sum('mon_champ')) Message édité par Remigio le 17-06-2011 à 14:01:10 --------------- Everybody can succeed, all you need is to believe |
nraynaud lol | dites, comment je peux supprimer la protection CSRF sur une vue qui est dans un egg ?
--------------- trainoo.com, c'est fini |
SekYo | Dans un egg directement j'en ai aucune idée, pour tes vues à toi y a le décorateur @csrf_exempt
|
nraynaud lol |
--------------- trainoo.com, c'est fini |
masklinn í dag viðrar vel til loftárása |
Message cité 1 fois Message édité par masklinn le 11-07-2011 à 11:28:30 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
nraynaud lol |
--------------- trainoo.com, c'est fini |
masklinn í dag viðrar vel til loftárása |
Accessoirement pas besoin de la re-wrapper, suffit d'avoir un truc genre
Message édité par masklinn le 11-07-2011 à 11:48:32 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
nraynaud lol | dites, en mode DEBUG=False, elle sont sensés sortir où les stacktraces ? --------------- trainoo.com, c'est fini |
Shinuza This is unexecpected | Elles peuvent être loggées par ton gateway. Sinon il faut les configurer avec la configuration du logger
--------------- Mains power can kill, and it will hurt the entire time you’re dying from it. |
Jubijub Parce que je le VD bien | Hum... c'est quand meme un peu crade avec Flask de devoir faire un try / except KeyError pour vérifier si une checkbox a été cochée dans un form... un petit helper qui te permettrait de savoir si le champ existe, ou faire que le champ ait une valeur à None aurait été sympa... Message édité par Jubijub le 16-07-2011 à 20:10:25 --------------- Jubi Photos : Flickr - 500px |
masklinn í dag viðrar vel til loftárása | 1. y u in django thread? This no django problem 2. request.form est un MultiDict. Comme les dict standards dont ils héritent, les multidicts ont une méthode .get() qui renvoie un placeholder (None par défaut) si la clé n'est pas trouvée 3. http://flask.pocoo.org/docs/patterns/wtforms/ Message cité 1 fois Message édité par masklinn le 16-07-2011 à 20:14:48 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
Jubijub Parce que je le VD bien |
1. Ain't no Flask thread, this is the closest one might get...and I doubt there are enough Flask users down here to justify a brand new one Message cité 1 fois Message édité par Jubijub le 16-07-2011 à 21:21:21 --------------- Jubi Photos : Flickr - 500px |
masklinn í dag viðrar vel til loftárása |
Message édité par masklinn le 16-07-2011 à 21:48:37 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
SekYo | Tiens d'ailleurs, c'est quoi les autres FW web python sympas (a part webpy) et quels sont leurs usages ? Genre pourquoi avoir choisi Flask et pas Django par exemple ? |
Jubijub Parce que je le VD bien |
La rapidité incroyable de prototypage... Il te faut un import et 2 lignes de code pour avoir un mini serveur qui répond a une requête... Sinon ça fait longtemps que je voulais me remettre a dev : Django j'y viendrai surement, mais par la suite. Pour débuter avec python Flask est terriblement plus accessible, et plus fun de ce fait. Du coup ça me décourage pas, et j'y travaille régulièrement...(je suis CdP donc faire du dev c pas une obligation pro) --------------- Jubi Photos : Flickr - 500px |
Shinuza This is unexecpected |
La vocation de Flask c'est de faire des choses simples rapidement avec un minimm de configuration, c'est adapté pour une petite webapp ou un webservice simple. Y'a Bottle aussi, mais j'ai jamais tenté. --------------- Mains power can kill, and it will hurt the entire time you’re dying from it. |
Jubijub Parce que je le VD bien |
--------------- Jubi Photos : Flickr - 500px |
el muchacho Comfortably Numb | Des outils pour monitorer la RAM du process Python, et les memleaks, vous connaissez ? --------------- Les aéroports où il fait bon attendre, voila un topic qu'il est bien |
SekYo | Perso les deux seules fois ou j'ai eu de gros problèmes de fuites mémoires par évident à trouver, j'utilisais le module hotshot et kcachegrind pour visualiser la sortie. |
![]() Publicité | Posté le ![]() ![]() |
Sujets relatifs | |
---|---|
Blabla@Progue | [Topic unique] .Net @ Prog |
Page Jsp qui affiche le ${ blabla } | case in blabla (KSH) ===> fichier CSV |
BlaBla@SQL | Problème de configuration MySQL sur Django |
Suivant / Précédant dans appli js (non c'est pas history.blabla ...) | Blabla@Python \o/ |
SBP: le Système d'unités de Blabla@Prog | |
Plus de sujets relatifs à : blabla@django |