text
stringlengths
0
14.1k
def validate(self, value, model_instance):
invalid_values = []
for val in value:
try:
validate_slug(val)
except ValidationError:
invalid_values.append(val)
if invalid_values:
# should really make a custom message.
raise ValidationError(self.error_messages['invalid_choice'] % invalid_values)
def _get_choices(self):
if isinstance(self._choices, RegistryIterator):
return self._choices.copy()
elif hasattr(self._choices, 'next'):
choices, self._choices = itertools.tee(self._choices)
return choices
else:
return self._choices
choices = property(_get_choices)
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
pass
else:
add_introspection_rules([], [""^philo\.models\.fields\.SlugMultipleChoiceField""])
add_introspection_rules([], [""^philo\.models\.fields\.TemplateField""])
add_introspection_rules([], [""^philo\.models\.fields\.JSONField""])" isc
nickleefly/gulp-boilerplate README.md 152 "# gulp boilerplate
run
`npm start`
then open another termianl
run `gulp watch` ,change some files for browser-syn
## Gulp tasks
* gulp
* gulp prod
" isc
nicholaides/Methanol-Web-Crawler src/libmetha/builtin.c 6361 "/*-
* builtin.c
* This file is part of libmetha
*
* Copyright (c) 2008, Emil Romanus <emil.romanus@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED ""AS IS"" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* http://bithack.se/projects/methabot/
*/
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/stat.h>
#include ""errors.h""
#include ""ftpparse.h""
#include ""worker.h""
#include ""urlengine.h""
#include ""io.h""
#include ""builtin.h""
/**
* Builtin parsers except for the html parser which is in html.c
**/
struct {
const char *name;
int len;
} protocols[] = {
{""http"", 4},
{""ftp"", 3},
};
/**
* Default CSS parser
**/
M_CODE
lm_parser_css(worker_t *w, iobuf_t *buf, uehandle_t *ue_h,
url_t *url, attr_list_t *al)
{
return lm_extract_css_urls(ue_h, buf->ptr, buf->sz);
}