background preloader


Facebook Twitter

Herramientas. Dougal Matthews Home. This is my unofficial part five for the Django tutorial. I've attempted to write this in a similar style to the Django documentation and hopefully this will be useful for those looking for the next step after the tutorial or trying out testing with django for the first time. Testing is something I think we can all do better, I certainly know I could do better testing my code sometimes. If you don't have the polls app from the end of part four and don't want to do it again you can grab it from my github. The code added in this tutorial is also available in the master branch of the repository.

This tutorial begins where Tutorial 4 left off. We're continuing the Web-poll application and will focus on testing our application and proving that it works as expected. The testing environment Let's first look at how you run the tests, make sure you are in the mysite directory and run the command python test.

Creating test database... What did we just test? What is a test? Writing a test. TDDjangoTutorial. Test-First! So, before we're allowed to write any real production code, we write some tests. We start by writing some browser tests - what I call functional tests, which simulate what an actual user would see and do. We'll use Selenium, a test tool which actually opens up a real web browser, and then drives it like a real user, clicking on links and buttons, and checking what is shown on the screen. These are the tests that will tell us whether or not our application behaves the way we want it to, from the user's point of view.

Once we've written our functional tests (which, incidentally, have forced us to think through the way our application will work, from the point of view of the user - never a bad thing...) we can start to think about how we want to implement that functionality from a technical point of view. Once we've settled on the function or the class that will solve our first problem, we can write a unit test for it. So here are our objectives for this first tutorial: [...] ClockingIT. Django-autocomplete - jquery AutoComplete for ForeignKey & ManyToManyField. Uses same syntax as the search for django-admin up: the latest version in Downloads - fixed compatibility with Django 1.3 - cleaned java scripts - added support for inline AutocompleteStackedInline, AutocompleteTabularInline - added a field WildModelSearchInput, it can be used in the admin forms requirements copy to the appropriate folder media\admin\js\jquery.autocomplete.js media\jquery.autocomplete.css example use a fairly simple in m2m field need to specify related_name class Celebrity(models.Model): name = models.CharField() class Film(models.Model): type = models.ForeignKey( Type ) director= models.ManyToManyField( Celebrity, related_name="director") actor = models.ManyToManyField( Celebrity, related_name="actor") NEW: for inline class Ceremony( PageSeo ): name =models.CharField( max_length = 200 ) guiding =models.ManyToManyField( Celebrity, related_name = "guiding", blank = True ) best_film=models.ForeignKey( Film, default = None, null = True, blank = True )

Tags · tuffy/python-audio-tools. CSS: Menu horizontal, desplegable y bonito | Jugando entre diseñadores. Email Marketing and Email List Manager. Sass - Syntactically Awesome Stylesheets. Before you can use Sass, you need to set it up on your project.

If you want to just browse here, go ahead, but we recommend you go install Sass first. Go here if you want to learn how to get everything setup. Extending the jQuery Sortable With Ajax & MYSQL ~ Wil Linssen. I’ve had a lot of response to the jQuery sortable list post I wrote a while back, and a lot of them ask how to send the results to a database. I’ve often said the best thing to do would be to update it by AJAX, but I’ve never really explained how. So here it is! There was a bug a few people noticed with the new jQuery UI a short while ago that stopped the update callback working. That bug has since been rectified and all is kosher again. I have since updated the example to the latest jQuery and UI downloads.

The examples and downloads have also been updated accordingly. Step one: Create the page with the sortable, and the CSS (described on my previous post) We have however altered it slightly, so here is the updated code (without any css, the css is in the sourcecode)Include your javascript files, you’ll need jQuery and the jQuery UI files Then you’ll need to create your Javascript function. Now here’s the HTML to output the list etc. etc: You could then happily run each sql statement. File: SASS_REFERENCE. Sass is an extension of CSS that adds power and elegance to the basic language. It allows you to use variables, nested rules, mixins, inline imports, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized, and get small stylesheets up and running quickly, particularly with the help of the Compass style library. Features Fully CSS-compatible Language extensions such as variables, nesting, and mixins Many useful functions for manipulating colors and other values Advanced features like control directives for libraries Well-formatted, customizable output Syntax There are two syntaxes available for Sass.

The second and older syntax, known as the indented syntax (or sometimes just "Sass"), provides a more concise way of writing CSS. Either syntax can import files written in the other. . # Convert Sass to SCSS $ sass-convert style.sass style.scss # Convert SCSS to Sass $ sass-convert style.scss style.sass Using Sass gem install sass Rack/Rails/Merb Plugin or. Simple horizontal list. Horizontal CSS List Menu. Posted on March 27, 2008 in CSS Tutorials This tutorial will show you how to make a horizontal CSS list menu. No images, no javascript. Just a simple, cross browser compatible CSS list menu! If you want to see the finished product or you just want the code, look here. First of all we’ll need the HTML for our list menu, this is just a normal unordered list.

It’s just a simple html page with an unordered list menu on. Next we’re going to add the CSS code for the div called menu that surrounds the list. Again this is nice and simple. Next we add the syling for the list and the list items. Again it’s all pretty simple, you should be able to understand the code with a little bit of CSS knowledge. Blog of Ryan Bigg - Ubuntu, Ruby, RVM, Rails, and You. SoundManager 2: JavaScript Sound For The Web. SoundManager 2 Demo: Play MP3 Links on a page. 360° MP3 player UI demo (SoundManager 2): Javascript + Canvas Visualization, basic example.

SoundManager 2 Demo: Play MP3 Links on a page. Inline MP3 Player Example: Fancy* CSS 3 version *CSS 3 border-radius supported only by Firefox 2.x+, Safari (2.x?) - sadly, not IE 8. How It Works Lightweight (single JS click event handler) Uses existing SoundManager 2 API CSS for UI, easy to modify to taste This example uses SoundManager 2 to find links to MP3 files, and makes them playable "in-place" on a page. Links pointing to MP3s are assigned an onclick handler which intercepts the click (preventing the browser from following the link and unloading the page. Static Examples CSS classes are dynamically applied as follows: :hover effects are also active. Flat (CSS-only) style Forcing play (or exclusion) of links If you have a link to a PHP file that serves MP3 files eg. <a href="/music.php? Or via CSS class name: <a href="/music.php? To exclude an .MP3 or otherwise-playable link from being handled by SM2, use class="inline-exclude" and it will be ignored.

SoundManager 2 project page (not an MP3 link) Basic CSS Other Options I'd like to use this. Pasar funcion como parametro. 2: Multiples parametros. : Software over the rainbow. En una entrada anterior comentaba cómo pasar el nombre de una función a otra como parámetro. Sin embargo, no sabía cómo pasarle un número indeterminado de parámetros a la función llamada. Tras varios intentos fallidos, lo dejé en el tintero.

Hoy, buscando otra cosa, he encontrado lo que me quedaba para solucionarlo en otro blog. Me explico: Cada vez que llamamos una función, de forma predefinida se crea dentro de esta un array de nombre arguments, que almacena todos los parámetros pasados. function a(param1, param2, param3) { trace(arguments); } a ("pepe", "juan", "jorge"); // la ventana de salida muestra : pepe, juan, jorge // * ya lo se, qué parametros mas aburridos * Dado que arguments es un array, podemos hacer todas las operaciones de esta clase con ella. Function a(param1, param2, param3) { trace(arguments.length); } a ("pepe", "juan", "jorge"); // la ventana de salida muestra : 3 La idea era pasar el array de parámetros de una funcion a la segunda, pero ahí me quedé.

Y eso es todo. Glossy.js (javascript glossy image effect) <form name="lst" id="lst" method="post" action=".. glossy.js 1.8 allows you to add corners and shading and shadow to images on your webpages (alternatively: corner.js). It works in all the major browsers - Mozilla Firefox 1.5+, Opera 9+, Safari and IE6+. On older browsers, it'll degrade and your visitors won't notice a thing.CVI-lab: Get a fast impression of the effects and their illustration qualities. Shows some of the things glossy.js does. 6 images with class = "glossy iradius50" cvi_glossy_lib.js supports additional appearances. Empty gif with class = "glossy ibgcolor00aa00 igradient00aaaa horizontal noshadow" 3 images with class = "glossy" Images used are copyrighted and are used for demonstration only.

HTML5 Video Player | Video.js. Video.js is a JavaScript and CSS library that makes it easier to work with and build on HTML5 video. This is also known as an HTML5 Video Player. Video.js provides a common controls skin built in HTML/CSS, fixes cross-browser inconsistencies, adds additional features like fullscreen and subtitles, manages the fallback to Flash or other playback technologies when HTML5 video isn't supported, and also provides a consistent JavaScript API for interacting with the video.

What's HTML5 Video? HTML is the markup language that makes up every page on the web. The newest version, HTML5, includes specifications for a <video> tag, that's meant to allow web developers to add a video to a page in the same way they would add an image. In order for this to work, web browser developers have built video playback functionality into their browsers. Playing video in a web page may not seem so special since you can already view video on a web page through plugins like Flash Player, Quicktime, and Silverlight.

.animate. Description: Perform a custom animation of a set of CSS properties. The .animate() method allows us to create animation effects on any numeric CSS property. The only required parameter is a plain object of CSS properties. This object is similar to the one that can be sent to the .css() method, except that the range of properties is more restrictive. Animation Properties and Values All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be, unless the jQuery.Color plugin is used). In addition to style properties, some non-style properties such as scrollTop and scrollLeft, as well as custom properties, can be animated. Shorthand CSS properties (e.g. font, background, border) are not fully supported.

Animated properties can also be relative. Duration Callback Functions Basic Usage Easing Demo: Arguments: A JavaScript Oddity. Arguments is the name of a local, array-like object available inside every function. It’s quirky, often ignored, but the source of much programming wizardry; all the major JavaScript libraries tap into the power of the arguments object. It’s something every JavaScript programmer should become familiar with. Inside any function you can access it through the variable: arguments, and it contains an array of all the arguments that were supplied to the function when it was called.

It’s not actually a JavaScript array; typeof arguments will return the value: "object". You can access the individual argument values through an array index, and it has a length property like other arrays, but it doesn’t have the standard Array methods like push and pop. Create Flexible Functions Even though it may appear limited, arguments is a very useful object. Format("And the %1 want to know whose %2 you %3", "papers", "shirt", "wear"); Convert it to a Real Array var args =;

Tienda de Equipos Médicos :: Silah & Moret. Tutorial. This tutorial is an introduction to using Mercurial. We don't assume any particular background in using SCM software. You might first want to read UnderstandingMercurial 1. Introduction After you work through this tutorial, you should have a grasp of the following: The basic concepts and commands you'll need to use Mercurial How to use Mercurial in simple ways to contribute to a software project It is also strongly recommended that you have a look at the Mercurial man pages hg(1) and hgrc(5), which are also available in the release tarballs as doc/hg.1.html and doc/hgrc.5.html.

The tutorial is split into the following pages: 2. The formatting convention is simple. A line of input that you should type into your shell or command prompt is displayed in a fixed font, and the line will start with a $ character. A line of output that you should expect Mercurial or your shell to display is displayed in a fixed font, but with no special character at the start of the line. 3. CategoryTutorial. Free source code hosting — Bitbucket.