[django channels] unrecognized arguments: --noworker

2017-11-10 Thread mccc
Hello, I'm trying out channels, but I'm getting an "unrecognized arguments: --noworker" error when trying to execute a very simple "python manage.py runserver --noworker". I found this file in the repository

Re: [django channels] unrecognized arguments: --noworker

2017-11-10 Thread mccc
nevermind, sorry about the spam: I had an old django-channels installation polluting my environment - I found out while gathering my libraries versions to post here... On Friday, November 10, 2017 at 2:05:29 PM UTC+1, mccc wrote: > > Hello, > > I'm trying out channels, b

Re: [OT] Is Trump planning to break the Internet?

2017-12-12 Thread mccc
I agree with Matthew's sentiment; also, I'd like to point out that the words you (Larry) posted are not your own but are literally coming off of foxnews.com (found also on telecoms.com

on_delete not getting called when ForeignKey is a property

2019-03-14 Thread mccc
Hello, I have set up this nice model: class CustomGroup(models.Model): name = models.CharField(max_length=255) _parent = models.ForeignKey( "self", on_delete=models.CASCADE, null=True, related_name="descendants", db_column="parent" ) _depth = models.IntegerField(default=1

Re: on_delete not getting called when ForeignKey is a property

2019-03-14 Thread mccc
On Thursday, March 14, 2019 at 4:22:15 PM UTC+1, Chetan Ganji wrote: > > Why do you need to do any calculations in the model code? > > I would do any calculations in the views and store them using models. That > will remove the getters and setters from model. > Everything should work fine then

multiple constraints not working in the db

2020-04-03 Thread mccc
Hello, I'm having issues getting multiple constraints to work (in postgres, if it matters). Here is the Meta: class Meta: constraints = [ CheckConstraint( check=(Q(target_value__gt=0) & ~Q(target_metric=DEFAULT)) | (Q(enabled=False) |

Re: multiple constraints not working in the db

2020-04-03 Thread mccc
oh, forgot: versions are Python 3.7.6 and Django 2.2.11 On Friday, April 3, 2020 at 7:46:40 PM UTC+2, mccc wrote: > > Hello, > > I'm having issues getting multiple constraints to work (in postgres, if it > matters). > Here is the Meta: > > &g

Prefetch object with to_attr set to the same name as the field triggers rows deletions

2015-11-05 Thread mccc
I'm using a Prefetch object to follow some GenericRelation, and I was playing around with the to_attr parameter; I had the DB debug turned on, as I was checking whether it was making any difference, and I started noticing some DELETE statements on the remote table, so I started investigating. It

DataError on get_or_create with nullable fields

2015-12-02 Thread mccc
Key. Attached traceback shows that the issue happens on creation, I believe. {{{ Traceback (most recent call last): File "", line 1, in File "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method return getatt

Re: DataError on get_or_create with nullable fields

2015-12-03 Thread mccc
Well turns out it was actually the `master_id` foreign key that was being set to garbage, hence the DataError; everything besides me is working as intended. cheers On Wednesday, December 2, 2015 at 6:03:22 PM UTC+1, mccc wrote: > > (this is mostly copied/pasted from my comment on an eight

queryset appears empty in debugger during testing, but not in console

2018-06-18 Thread mccc
Hello, I'm testing REST APIs with rest_framework.test.APITestCase, using their client for making requests and model_mommy for creating objects in the setUp() method. The general working is quite simple: the view is supposed to fetch a User and an object, and assign permissions for the former to

Re: Meta indexes and makemigrations

2024-12-05 Thread mccc
nel_type and '42' match your schema's type expectations. >2. > >Confirm makemigrations is running in the correct app and picking up >changes: > >python manage.py makemigrations your_app_name > >3. > >Review your

Meta indexes and makemigrations

2024-12-05 Thread mccc
Hello, We want to have a partial index (db backend is Postgres) on a datetimefield, so we added this code to the Meta class: class Episode(models.Model): channel_type = models.CharField(max_length=16, choices=CHANNEL_TYPES) last_seen_date = models.DateTimeField(auto_now_add=True) cla