Quantcast
Channel: User Christoffer - Stack Overflow
Browsing all 45 articles
Browse latest View live

Comment by Christoffer on How can I indent multiple lines in Xcode?

This also works for us that does not work on an american keyboard :)

View Article



Comment by Christoffer on In xcode 9 with iOS 11 - issue with loading of Map...

@KosukeOgawa Just tried that, but makes no difference. Also not something I would want, as that would ruin usability as the map would be reloaded to often.

View Article

Comment by Christoffer on In xcode 9 with iOS 11 - issue with loading of Map...

I just tried. Unfortunately it did not do anything

View Article

Comment by Christoffer on Navigation bar jumps in iPhone X when using Toolbar

@Shebuka What do you mean with that?

View Article

Comment by Christoffer on Navigation bar jumps in iPhone X when using Toolbar

I do not use Storyboards so this is not possible for me

View Article


Comment by Christoffer on How can I substitute the UITabBar of...

That gives me the following error: Cannot convert return expression of type 'customTabBar.Type' to return type 'UITabBar'. Any ideas?

View Article

Comment by Christoffer on How to merge two configmaps using volume mount in...

Make sure you have no out commented lines (# something) in your file as that for some reason will make the double volumeMounts fail. Please add that to your answer.

View Article

Comment by Christoffer on Django settings when using pgbouncer

default_pool_size should for sure be lower than max_client_conn in your pgbouncer.ini. Your default_pool_size is the amount of connections to your database from pgbouncer (per user. Most setups only...

View Article


Answer by Christoffer for How do I restrict access to admin pages in Django?

Overwrite the admin_view part of the AdminSite class before using it in the urls. In admin.py file (create it if you don't have it) add: from functools import update_wrapper from django.http import...

View Article


Answer by Christoffer for After upgrading to google maps api 3.17 all fails

The problem is that place under marker > options has become a used key by the google api. Changed place to myplace and you are up and running again: marker: { options: { icon: new...

View Article

After upgrading to google maps api 3.17 all fails

I get this error in the api's main.js Uncaught InvalidValueError: setPlace: unknown property attributes Can't figure out what is causing it. Or what specific functionality is failing. Will update...

View Article

Django rest framework outputs JSONField with unicode prefix [duplicate]

This question already has an answer here: Django Rest Framework and JSONField 11 answers In my api the output of JSONField looks like so: "custom_content": "{u'key': u'value', u'hej': 1.992}", Should...

View Article

Answer by Christoffer for How can I apply a filter to a nested resource in...

I would do it in one of two ways. 1) Either do it through prefetch in your view: serializer = ZoneSerializer(Zone.objects.prefetch_related( Prefetch('zone_permission_set',...

View Article


Answer by Christoffer for How to Serialize with field from reverse related...

If you for some reason don't want to go through the through model like @Linovia suggests, then you can prefetch the through model and use a RelatedField with an overwritten to_representation. This is...

View Article

How to Serialize with field from reverse related model - Django rest framework

I have an api that retrieves all items related to a project through a manytomany model with an extra order field. I am now trying to serialize the items with the order value on it. One solution would...

View Article


New environment varibles does not show up in django app

I have added some new environment variables to my virtualenv. Added: export BROKER_URL='amqp://guest:guest@localhost/prod' to my bin/activate file. But reloading uswgi does not make the new variables...

View Article

Answer by Christoffer for New environment varibles does not show up in django...

The problem is that uwsgi does not pick up variables in the activate file. Guess it is not using it when run by supervisor Solution is to add the environment variable to the uwsgi ini file like so: env...

View Article


Answer by Christoffer for How to pass options to CloudinaryField in Django...

You can also add these kind of options to the form field like so: image = CloudinaryFileField( label='My image', options={ 'tags': "module, home", 'format': 'jpg', 'crop': 'limit', 'width': 640 },...

View Article

Get object from list of objects without extra database calls - Django

I have an import of objects where I want to check against the database if it has already been imported earlier, if it has I will update it, if not I will create a new one. But what is the best way of...

View Article

Answer by Christoffer for Excluding password when extending UserCreationForm

You can just remove the password2 field in the init of the form like so: class MyUserCreationForm(UserCreationForm): def __init__(self, *args, **kargs): super(MyUserCreationForm, self).__init__(*args,...

View Article
Browsing all 45 articles
Browse latest View live




Latest Images