Skip to content

Instantly share code, notes, and snippets.

View rockyburt's full-sized avatar

Rocky Burt rockyburt

View GitHub Profile
../../.venv/lib/python3.9/site-packages/strawberry/schema/schema_converter.py:83: in from_argument
argument_type = self.from_optional(argument.type)
../../.venv/lib/python3.9/site-packages/strawberry/schema/schema_converter.py:273: in from_optional
return self.from_type(type_.of_type)
../../.venv/lib/python3.9/site-packages/strawberry/schema/schema_converter.py:455: in from_type
return self.from_scalar(type_)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <strawberry.schema.schema_converter.GraphQLCoreConverter object at 0x7ff6574a2e20>, scalar = <function NewType.<locals>.new_type at 0x7ff65a2daee0>
import strawberry
from dataclasses import dataclass
# namespace mimicks a class being used as an attribute of an imported module named "namespace"
class namespace:
class MyField:
...
from dataclasses import dataclass
from typing import NewType
import strawberry
@dataclass
class Widget:
field1: "Mm"
from typing import Any, NewType
import strawberry
GenericValue = strawberry.scalar(
NewType("GenericMapping", Any),
serialize=lambda v: v,
parse_value=lambda v: v,
)
class ExtField:
def __init__(self, node, parent=None):
self.node = node
self.parent = parent
@cached_property
def name(self) -> str:
return underscore(self.node.name.value if hasattr(self.node, "name") else "N/A")
@cached_property
<script type="module">
const helloWorld = function() {
console.log('hello world!');
};
export default { helloWorld };
</script>
<script>
// is there anyway for me to access helloWorld defined by the above script/module block?
</script>
from functools import wraps
from django.views.decorators.cache import cache_page
from django.utils.decorators import available_attrs
def cache_anon_page(timeout, key_prefix=None):
cpdec = cache_page(timeout, key_prefix=key_prefix)
def decorator(view_func):
Prerequisites/Assumptions:
- PC with running Ubuntu on a standard HDD
- HDD has two partitions: 1x swap and 1x ext4
- HDD is /dev/sda
- SSD is /dev/sdb
1. Boot into Ubuntu Live CD (USB)
2. Initial SSD setup - using gparted
i) make sure SSD is empty (no partitions)
(venv) rocky@alienware:~/dev/projects/iadvantage/torontorentals/vcs/apartmentrentals$ ./manage.py migrate
Operations to perform:
Apply all migrations: accounts, admin, auth, captcha, contenttypes, core, django_cron, djcelery, feeds, flatblocks, payments, search, sessions, sites
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/home/rocky/dev/projects/iadvantage/torontorentals/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/rocky/dev/projects/iadvantage/torontorentals/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
[2016-08-08 17:29:09,334: E] [django.request] Internal Server Error: /admin/login/
Traceback (most recent call last):
File "/home/rocky/dev/projects/iadvantage/rentals/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/rocky/dev/projects/iadvantage/rentals/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/home/rocky/dev/projects/iadvantage/rentals/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/rocky/dev/projects/iadvantage/rentals/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)