Re: how to set up a calculated field in Django?

2019-10-22 Thread nm
One way I can think of is to add a property to your model. I believe something like this should work: ``` ## in your model class: mother_alive = models.IntegerField(choices=YES_NO_CHOICES, blank=True, null=True, default=1) fath

Re: Django sockets

2019-08-28 Thread nm
Perhaps you're looking for Django Channels? On Tuesday, 27 August 2019 15:08:47 UTC+2, Suraj Thapa FC wrote: > > Anyone know making chat app using sockets in rest api > -- You received this message because you are subscribed to the Google Groups "D

Re: Write urls without regex in DRF

2019-05-23 Thread nm
Yes, it's possible to write this code without using regexp, and it should work the same. If you have a look at the source code of the routers, there's a method `get_urls` in SimpleRouter (you can find it here https://github.com/encode/django-rest-framework/blob/master/rest_framework/routers.py)

Re: Website slowed down drasticaly

2019-05-02 Thread nm
Django Debug Toolbar is a useful tool, it'll tell you what takes the biggest amount of time while the website loads. One caveat regarding performance: I once developed a project (running Django 1.8 and Python 3.4), and the Toolbar slowed down our back end tremendously. We tried to figure out t

Re: Step-by-Step Machine Learning with Python [Full Packt Paid Video Course for free]

2019-04-16 Thread nm
Yesterday I received an invitation to a google group from the same user, as well as two emails with links to purportedly educational videos (I haven't opened those links though). The entire list of recipients was visible, and I got pretty pissed that my email was there too. On Tuesday, 16 April

Re: Complex query on inner join - case for __ne?

2019-04-15 Thread nm
I've only had a quick look at your problem, but looks like maybe this section of the Django documentation could be useful: https://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships On Friday, 12 April 2019 15:10:59 UTC+2, Michael Thomas wrote: > > Hello everyo

Re: upgrading the pip version in dockerized django container

2019-04-10 Thread nm
Try `exec` instead of `run`. `run` runs the command in a new container, so each time you perform `docker-compose run web `, a new copy of the container is created. See the documentation: https://docs.docker.com/compose/reference/run/ On Wednesday, 10 April 2019 11:56:53 UTC+2, Shubham Joshi wr

Re: I Am A Begginer Web Developer - Need Help With Finding A Term

2019-04-02 Thread nm
Hi Rok, I suppose you want to *list* all your posts :) List is where you display many instances on one page (and your url is e.g. `.../classes/`). And as you probably already know, if you want to retrieve just one post (or class, or whatever you call it), you need a detail view, and the url wil

Re: Must be my and and can't be my code -- tracing back a URL pattern type mismatch

2019-04-01 Thread nm
n fact use Django Debug Toolbar. > > On Mon, Apr 1, 2019 at 9:19 AM nm > > wrote: > >> Do you use any additional packages like e.g. Django Debug Toolbar? Or >> anything else that could mess with your urls? This is just a wild guess, >> but since nobody has answered

Re: Must be my and and can't be my code -- tracing back a URL pattern type mismatch

2019-04-01 Thread nm
Do you use any additional packages like e.g. Django Debug Toolbar? Or anything else that could mess with your urls? This is just a wild guess, but since nobody has answered with a better idea yet... On Sunday, 31 March 2019 04:31:42 UTC+2, Josh Marshall wrote: > > I'm helping out on a project,

Re: how to create a Django project without using an IDE, but using the django-admin startproject command

2019-03-10 Thread nm
As others have pointed out, the problem might be not having your virtual env activated. If it's your first time with Django, there are very clear installation and set-up instructions in the Django Girls tutorial - also for Windows. I highly recommend it for a start. On a side note, I'd also rec

Re: Use of asyncio

2019-02-07 Thread nm
If you're specifically looking for Django-related uses of asyncio, there's Channels for websockets (and other stuff). You can find an example application - a simple chat - in the tutorial in the documentation. W dniu sobota, 2 lutego 2019 03:39:57 UT

Re: Problems from writing test cases.

2018-12-13 Thread nm
Regarding the first question and the problem with retrieving the user with `pk=1`: When you run your tests, Django creates a test database where all the objects created by the test cases are stored, and which is destroyed after all the tests are run. Each user you create gets a *new* pk. The pk

Enable profiling in internal development webserver

2007-01-16 Thread nm
How to enable profiling in internal development webserver? This http://code.djangoproject.com/wiki/ProfilingDjango doesn't help. Thanks, Nuno Mariz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Pagination too slow in Admin interface

2007-01-12 Thread nm
I have 301220 records in a simple(3 cols) mysql table and in the Admin interface the pagination is too slow, even with only 10 records per page. There are any reason for this? Curious, is when I click in a visited page is fast. Thanks, Nuno Mariz --~--~-~--~~~--

Hosting a Django project in Bluehost

2006-06-17 Thread nm
Hi all, I'm trying to run a project hosted in Bluehost, it only supports fcgi. I'm an apache guy. Anyone have a project maded with Django hosted in Bluehost? Thanks, Nuno --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Hosting a Django project in Bluehost

2006-06-16 Thread nm
Hi all, I'm trying to run a project hosted in Bluehost, it only supports fcgi. I'm an apache guy. Anyone have a project maded with Django hosted in Bluehost? Thanks, Nuno --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Accessing logged-in user object in models

2006-06-13 Thread nm
Ok, I will give a try. Thanks all. Nuno Quoting Michael Radziej <[EMAIL PROTECTED]>: > > Don Arbow wrote: >> Then in the view that calls the template, you determine if the user >> is authorized to edit the field. > > You don't have a view function with an Admin page ... that doesn't work. > > B

Re: Accessing logged-in user object in models

2006-06-13 Thread nm
I have a problem then. I just need to test if a user have permission to edit a field in Admin. Quoting Michael Radziej <[EMAIL PROTECTED]>: > > [EMAIL PROTECTED] wrote: >> Hi, >> I need the access to the logged-in user object in a model, to verify >> permissions. >> How I do that? > > You can't.

Accessing logged-in user object in models

2006-06-13 Thread nm
Hi, I need the access to the logged-in user object in a model, to verify permissions. How I do that? I've tryed: from django.http import HttpRequest class xxx(models.Model): [...] request = HttpRequest() user = request.user Don't work. Thanks, Nuno --~--~-~--~