function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def __init__( self, *, routes: Optional[List["MatchedRoute"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, route: "RouteProperties", message: Optional["RoutingMessage"] = None, twin: Optional["RoutingTwin"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, result: Optional[Union[str, "TestResultStatus"]] = None, details: Optional["TestRouteResultDetails"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, compilation_errors: Optional[List["RouteCompilationError"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, id: Optional[str] = None, type: Optional[str] = None, unit: Optional[str] = None, current_value: Optional[int] = None, limit: Optional[int] = None, name: Optional["Name"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["UserSubscriptionQuota"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def _get_template(template_string): if __is_18: return engines["django"].from_string(template_string) else: return loader.get_template_from_string(template_string)
mbi/django-simple-captcha
[ 1296, 306, 1296, 33, 1333550136 ]
def test(request): class CaptchaTestForm(forms.Form): subject = forms.CharField(max_length=100) sender = forms.EmailField() captcha = CaptchaField(help_text="asdasd") return _test(request, CaptchaTestForm)
mbi/django-simple-captcha
[ 1296, 306, 1296, 33, 1333550136 ]
def test_custom_generator(request): class CaptchaTestModelForm(forms.ModelForm): subject = forms.CharField(max_length=100) sender = forms.EmailField() captcha = CaptchaField(generator=lambda: ("111111", "111111")) class Meta: model = User fields = ("subject",...
mbi/django-simple-captcha
[ 1296, 306, 1296, 33, 1333550136 ]
def test_per_form_format(request): class CaptchaTestFormatForm(forms.Form): captcha = CaptchaField( help_text="asdasd", error_messages=dict(invalid="TEST CUSTOM ERROR MESSAGE"), output_format=( "%(image)s testPerFieldCustomFormatString " "%...
mbi/django-simple-captcha
[ 1296, 306, 1296, 33, 1333550136 ]
def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file)
dz0ny/mopidy-api-explorer
[ 20, 5, 20, 2, 1403610839 ]
def __init__ (self, id, status, response, ident = None): rcache.Result.__init__ (self, status, ident) self.node = id self.__response = response
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def reraise (self): if self.status_code >= 300: try: self.__response.expt except AttributeError: # redircting to HTTPError raise exceptions.HTTPError ("%d %s" % (self.status_code, self.reason)) else: self.__respo...
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def cache (self, timeout = 60, cache_if = (200,)): if not timeout: return if self.status != NORMAL or self.status_code not in cache_if: return rcache.Result.cache (self, timeout) return self
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def one (self, cache = None, cache_if = (200,)): try: return self.fetch (cache, cache_if, True) except (PGIntegrityError, sqlite3.IntegrityError): # primary or unique index error raise exceptions.HTTPError ("409 Conflict")
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __init__ (self, results, ident = None): self.results = results self.status_code = [rs.status_code for rs in results] rcache.Result.__init__ (self, [rs.status for rs in self.results], ident)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def data (self): return [r.data for r in self.results]
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def text (self): return [r.text for r in self.results]
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def cache (self, timeout = 60, cache_if = (200,)): if [_f for _f in [rs.status != NORMAL or rs.status_code not in cache_if for rs in self.results] if _f]: return rcache.Result.cache (self, timeout) return self
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def one (self, cache = None, cache_if = (200,)): self.cache (cache, cache_if) return [r.one () for r in self.results]
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __init__ (self, cv, id, ident = None, filterfunc = None, cachefs = None, callback = None): self._cv = cv self.id = id self.ident = ident self.filterfunc = filterfunc self.cachefs = cachefs self.callback = callback self.creation_time = time.time () self...
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def get_status (self): with self._cv: return self.status
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def set_status (self, code, result = None): with self._cv: self.status = code if result: self.result = result return code
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def do_filter (self): if self.filterfunc: self.filterfunc (self.result)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def handle_result (self, handler): if self.get_status () == TIMEOUT: # timeout, ignore return response = handler.response # DON'T do_filter here, it blocks select loop if response.code >= 700: if response.code == 702: status = TIMEOUT ...
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __init__ (self, cluster, uri, params = None, reqtype = "get", headers = None, auth = None, meta = None, use_cache = False, mapreduce = True, filter = None, callback = None, cache = None, timeout = 10, ori...
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def add_proto (cls, name, class_): cls.proto_map [name] = class_
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __del__ (self): self._cv = None self._results = []
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def _add_header (self, n, v): if self._headers is None: self._headers = {} self._headers [n] = v
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def _build_request (self, method, params): self._cached_request_args = (method, params) # backup for retry if self._use_cache and rcache.the_rcache: self._cached_result = rcache.the_rcache.get (self._get_ident (), self._use_cache) if self._cached_result is not None: ...
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def _get_connection (self, id = None): if id is None: id = self._nodes.pop () else: self._nodes = [] asyncon = self._cluster.get (id) self._setup (asyncon) return asyncon
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def _cancel (self): with self._cv: self._canceled = True
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def _fail_log (self, status): if self._origin: self._logger ("backend status is {}, {} at {} LINE {}: {}".format ( status, self._origin [3], self._origin [1], self._origin [2], self._origin [4][0].strip () ), "debug")
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def _do_callback (self, callback): result = self.dispatch (wait = False) tuple_cb (result, callback)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def rerequest (self): self._build_request (*self._cached_request_args)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def set_callback (self, callback, reqid = None, timeout = None): if reqid is not None: self._meta ["__reqid"] = reqid if self._cv: with self._cv: requests = self._requests self._callback = callback else: # already finished or w...
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def _wait (self, timeout = None): timeout and self.reset_timeout (timeout) remain = self._timeout - (time.time () - self._init_time) if remain > 0: with self._cv: if self._requests and not self._canceled: self._cv.wait (remain) self._cance...
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def dispatch_or_throw (self, cache = None, cache_if = (200,), timeout = None): return self.dispatch (cache, cache_if, reraise = True, timeout = timeout)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def wait (self, timeout = None, reraise = False): return self.dispatch (reraise = reraise, timeout = timeout)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def commit (self, timeout = None): return self.wait (timeout, True)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def fetch (self, cache = None, cache_if = (200,), timeout = None): res = self._cached_result or self.dispatch (timeout = timeout, reraise = True) return res.fetch (cache or self._cache_timeout, cache_if)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def then (self, func): from ..tasks import Future return Future (self, self._timeout, **self._meta).then (func)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __init__(self, send, name): self.__send = send self.__name = name
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __call__(self, *args): return self.__send(self.__name, args)
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __init__ (self, __class, *args, **kargs): self.__class = __class self.__args = args self.__kargs = kargs
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __exit__ (self, type, value, tb): pass
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __request (self, method, params): cdc = self.__class (*self.__args, **self.__kargs) cdc._build_request (method, params) return cdc
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def __init__ (self, cluster, logger, cachesfs): self.cluster = cluster self.logger = logger self.cachesfs = cachesfs
hansroh/skitai
[ 3, 1, 3, 1, 1482310026 ]
def train(args, extra_args): env_type, env_id = get_env_type(args.env) print('env_type: {}'.format(env_type)) total_timesteps = int(args.num_timesteps) seed = args.seed learn = get_learn_function(args.alg) alg_kwargs = get_learn_function_defaults(args.alg, env_type) alg_kwargs.update(extra...
dsbrown1331/CoRL2019-DREX
[ 43, 11, 43, 22, 1570219415 ]
def get_env_type(env_id): if env_id in _game_envs.keys(): env_type = env_id env_id = [g for g in _game_envs[env_type]][0] else: env_type = None for g, e in _game_envs.items(): if env_id in e: env_type = g break assert env_type i...
dsbrown1331/CoRL2019-DREX
[ 43, 11, 43, 22, 1570219415 ]
def get_alg_module(alg, submodule=None): submodule = submodule or alg try: # first try to import the alg module from baselines alg_module = import_module('.'.join(['baselines', alg, submodule])) except ImportError: # then from rl_algs alg_module = import_module('.'.join(['rl_...
dsbrown1331/CoRL2019-DREX
[ 43, 11, 43, 22, 1570219415 ]
def get_learn_function_defaults(alg, env_type): try: alg_defaults = get_alg_module(alg, 'defaults') kwargs = getattr(alg_defaults, env_type)() except (ImportError, AttributeError): kwargs = {} return kwargs
dsbrown1331/CoRL2019-DREX
[ 43, 11, 43, 22, 1570219415 ]
def parse(v): assert isinstance(v, str) try: return eval(v) except (NameError, SyntaxError): return v
dsbrown1331/CoRL2019-DREX
[ 43, 11, 43, 22, 1570219415 ]
def main(): # configure logger, disable logging in child MPI processes (with rank > 0) arg_parser = common_arg_parser() args, unknown_args = arg_parser.parse_known_args() extra_args = parse_cmdline_kwargs(unknown_args) if MPI is None or MPI.COMM_WORLD.Get_rank() == 0: rank = 0 logg...
dsbrown1331/CoRL2019-DREX
[ 43, 11, 43, 22, 1570219415 ]
def kelvin_dict_to(d, target_temperature_unit): """ Converts all the values in a dict from Kelvin temperatures to the specified temperature format. :param d: the dictionary containing Kelvin temperature values :type d: dict :param target_temperature_unit: the target temperature unit, may be: ...
csparpa/pyowm
[ 746, 159, 746, 16, 1378111431 ]
def kelvin_to_fahrenheit(kelvintemp): """ Converts a numeric temperature from Kelvin degrees to Fahrenheit degrees :param kelvintemp: the Kelvin temperature :type kelvintemp: int/long/float :returns: the float Fahrenheit temperature :raises: *TypeError* when bad argument types are provided ...
csparpa/pyowm
[ 746, 159, 746, 16, 1378111431 ]
def metric_wind_dict_to_km_h(d): """ Converts all the wind values in a dict from meters/sec to km/hour. :param d: the dictionary containing metric values :type d: dict :returns: a dict with the same keys as the input dict and values converted to km/hour """ result = {} for ...
csparpa/pyowm
[ 746, 159, 746, 16, 1378111431 ]
def metric_wind_dict_to_beaufort(d): """ Converts all the wind values in a dict from meters/sec to the corresponding Beaufort scale level (which is not an exact number but rather represents a range of wind speeds - see: https://en.wikipedia.org/wiki/Beaufort_scale). Conversion table: https://www.win...
csparpa/pyowm
[ 746, 159, 746, 16, 1378111431 ]
def get_log(): return logging.getLogger(__name__.split('.')[0])
thefactory/marathon-python
[ 199, 152, 199, 25, 1398275002 ]
def default(self, obj): if hasattr(obj, 'json_repr'): return self.default(obj.json_repr()) if isinstance(obj, datetime.datetime): return obj.strftime('%Y-%m-%dT%H:%M:%S.%fZ') if isinstance(obj, collections.Iterable) and not isinstance(obj, str): try: ...
thefactory/marathon-python
[ 199, 152, 199, 25, 1398275002 ]
def default(self, obj): if hasattr(obj, 'json_repr'): return self.default(obj.json_repr(minimal=True)) if isinstance(obj, datetime.datetime): return obj.strftime('%Y-%m-%dT%H:%M:%S.%fZ') if isinstance(obj, collections.Iterable) and not isinstance(obj, str): ...
thefactory/marathon-python
[ 199, 152, 199, 25, 1398275002 ]
def to_snake_case(camel_str): s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camel_str) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
thefactory/marathon-python
[ 199, 152, 199, 25, 1398275002 ]
def __init__(self, **kw): self.__dict__.update(kw) self.version = version
reflectometry/direfl
[ 2, 1, 2, 1, 1326382128 ]
def add_argument_group(name): arg = parser.add_argument_group(name) arg_lists.append(arg) return arg
MichelDeudon/neural-combinatorial-optimization-rl-tensorflow
[ 221, 63, 221, 1, 1493586256 ]
def get_config(): config, unparsed = parser.parse_known_args() return config, unparsed
MichelDeudon/neural-combinatorial-optimization-rl-tensorflow
[ 221, 63, 221, 1, 1493586256 ]
def main(): parser = argparse.ArgumentParser(description=__doc__.strip()) parser.add_argument('-p', '--ports', type=int, default=4, help="number of ports") parser.add_argument('-n', '--name', type=str, help="module name") parser.add_argument('-o', '--output', type=str, help="output file name") a...
alexforencich/xfcp
[ 39, 18, 39, 6, 1478123312 ]
def get_market_price_summary(asset1, asset2, with_last_trades=0): # DEPRECATED 1.5 result = assets_trading.get_market_price_summary(asset1, asset2, with_last_trades) return result if result is not None else False #^ due to current bug in our jsonrpc stack, just return False if None is returned
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_market_cap_history(start_ts=None, end_ts=None): now_ts = calendar.timegm(time.gmtime()) if not end_ts: # default to current datetime end_ts = now_ts if not start_ts: # default to 30 days before the end date start_ts = end_ts - (30 * 24 * 60 * 60) data = {} results = {} ...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_market_info(assets): assets_market_info = list(config.mongo_db.asset_market_info.find({'asset': {'$in': assets}}, {'_id': 0})) extended_asset_info = config.mongo_db.asset_extended_info.find({'asset': {'$in': assets}}) extended_asset_info_dict = {} for e in extended_asset_info: if not e.g...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_market_info_leaderboard(limit=100): """returns market leaderboard data for both the XCP and BTC markets""" # do two queries because we limit by our sorted results, and we might miss an asset with a high BTC trading value # but with little or no XCP trading activity, for instance if we just did one q...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_market_price_history(asset1, asset2, start_ts=None, end_ts=None, as_dict=False): """Return block-by-block aggregated market history data for the specified asset pair, within the specified date range. @returns List of lists (or list of dicts, if as_dict is specified). * If as_dict is False, each ...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_trade_history(asset1=None, asset2=None, start_ts=None, end_ts=None, limit=50): """ Gets last N of trades within a specific date range (normally, for a specified asset pair, but this can be left blank to get any/all trades). """ assert (asset1 and asset2) or (not asset1 and not asset2) # can...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_o_pct(o): if o['give_asset'] == config.BTC: # NB: fee_provided could be zero here pct_fee_provided = float((D(o['fee_provided_remaining']) / D(o['give_quantity']))) else: pct_fee_provided = None if o['get_asset'] == config.BTC: # NB: fee_required could be zero h...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def make_book(orders, isBidBook): book = {} for o in orders: if o['give_asset'] == base_asset: if base_asset == config.BTC and o['give_quantity'] <= config.ORDER_BTC_DUST_LIMIT_CUTOFF: continue # filter dust orders, if necessary give_quan...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_order_book_simple(asset1, asset2, min_pct_fee_provided=None, max_pct_fee_required=None): # DEPRECATED 1.5 base_asset, quote_asset = util.assets_to_asset_pair(asset1, asset2) result = _get_order_book( base_asset, quote_asset, bid_book_min_pct_fee_provided=min_pct_fee_provided, ...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_order_book_buysell(buy_asset, sell_asset, pct_fee_provided=None, pct_fee_required=None): # DEPRECATED 1.5 base_asset, quote_asset = util.assets_to_asset_pair(buy_asset, sell_asset) bid_book_min_pct_fee_provided = None bid_book_min_pct_fee_required = None bid_book_max_pct_fee_required = None ...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_users_pairs(addresses=[], max_pairs=12): return dex.get_users_pairs(addresses, max_pairs, quote_assets=[config.XCP, config.XBTC])
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_market_orders(asset1, asset2, addresses=[], min_fee_provided=0.95, max_fee_required=0.95): return dex.get_market_orders(asset1, asset2, addresses, None, min_fee_provided, max_fee_required)
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_market_trades(asset1, asset2, addresses=[], limit=50): return dex.get_market_trades(asset1, asset2, addresses, limit)
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_markets_list(quote_asset=None, order_by=None): return dex.get_markets_list(quote_asset=quote_asset, order_by=order_by)
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def get_market_details(asset1, asset2, min_fee_provided=0.95, max_fee_required=0.95): return dex.get_market_details(asset1, asset2, min_fee_provided, max_fee_required)
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def task_compile_asset_market_info(): assets_trading.compile_asset_market_info() # all done for this run...call again in a bit start_task(task_compile_asset_market_info, delay=COMPILE_ASSET_MARKET_INFO_PERIOD)
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def parse_trade_book(msg, msg_data): # book trades if(msg['category'] == 'order_matches' and ((msg['command'] == 'update' and msg_data['status'] == 'completed') or # for a trade with BTC involved, but that is settled (completed) ('forward_asset' in msg_data and msg_data['forward_asset'] != confi...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def init(): # init db and indexes # trades config.mongo_db.trades.ensure_index( [("base_asset", pymongo.ASCENDING), ("quote_asset", pymongo.ASCENDING), ("block_time", pymongo.DESCENDING) ]) config.mongo_db.trades.ensure_index( # tasks.py and elsewhere (for singlular b...
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def start_tasks(): start_task(task_compile_asset_pair_market_info) start_task(task_compile_asset_market_info)
CounterpartyXCP/counterblock
[ 15, 68, 15, 21, 1390186591 ]
def adicionar_novo_movimento_estoque(self, itens_mvmt_obj, pform, lista_produtos, lista_produtos_estocados): prod = itens_mvmt_obj.produto lista_produtos.append(prod) # Modificar valor do estoque atual dos produtos if prod.estoque_atual is not None and isinstance(self.object, EntradaEst...
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def get_success_message(self, cleaned_data): return self.success_message % dict(cleaned_data, pk=self.object.pk)
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def get(self, request, *args, **kwargs): self.object = None form_class = self.get_form_class() form = form_class() form.initial['data_movimento'] = datetime.today().strftime('%d/%m/%Y') itens_form = ItensMovimentoFormSet(prefix='itens_form') return self.render_to_respon...
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'ADICIONAR ENTRADA EM ESTOQUE' context['return_url'] = reverse_lazy( 'estoque:listaentradasestoqueview') return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'ADICIONAR SAÍDA EM ESTOQUE' context['return_url'] = reverse_lazy('estoque:listasaidasestoqueview') return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'ADICIONAR TRANSFERÊNCIA EM ESTOQUE' context['return_url'] = reverse_lazy( 'estoque:listatransferenciasestoqueview') return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def get_context_data(self, **kwargs): context = super(MovimentoEstoqueBaseListView, self).get_context_data(**kwargs) return self.view_context(context)
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'TODAS AS MOVIMENTAÇÕES DE ESTOQUE' return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def post(self, request, *args, **kwargs): if self.check_user_delete_permission(request, MovimentoEstoque): for key, value in request.POST.items(): if value == "on": if EntradaEstoque.objects.filter(id=key).exists(): instance = EntradaEstoqu...
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'ENTRADAS EM ESTOQUE' context['add_url'] = reverse_lazy('estoque:addentradaestoqueview') return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'SAÍDAS EM ESTOQUE' context['add_url'] = reverse_lazy('estoque:addsaidaestoqueview') return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'TRANSFERÊNCIAS EM ESTOQUE' context['add_url'] = reverse_lazy( 'estoque:addtransferenciaestoqueview') return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def get_context_data(self, **kwargs): context = super(DetalharMovimentoEstoqueBaseView, self).get_context_data(**kwargs) return self.view_context(context)
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'MOVIMENTO DE ENTRADA EM ESTOQUE N°' + \ str(self.object.id) context['return_url'] = reverse_lazy( 'estoque:listaentradasestoqueview') return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]
def view_context(self, context): context['title_complete'] = 'MOVIMENTO DE SAÍDA EM ESTOQUE N°' + \ str(self.object.id) context['return_url'] = reverse_lazy('estoque:listasaidasestoqueview') return context
thiagopena/djangoSIGE
[ 343, 223, 343, 40, 1481383504 ]