bulk_update() causes Select N+1 issue

2023-01-13 Thread Nick Chang
tually generates N number of SELECT statements where N is the size of 'update_list' This is being flagged as Select N+1 bug. Why did bulk_update() not generate a single query as it advertises? How would I fix this Select N+1 issue to increase the performance? Kind Regards, Nick -- You re

Re: Move apps to different folders or to a root folder

2022-11-10 Thread Nick Chang
break it? And it can be fixed by specifying the 'db_table" value in the moved models? Thanks! On Sunday, November 6, 2022 at 10:09:41 PM UTC-5 Mike Dewhirst wrote: > On 7/11/2022 2:40 am, Nick Chang wrote: > > Hello community, > > I am trying to organize my Django

Move apps to different folders or to a root folder

2022-11-06 Thread Nick Chang
Hello community, I am trying to organize my Django project's structure as the number of apps is growing. So I am attempting to move an app in the sub-folder that contains its model definitions. The app used to be named `< sub_folder_name>.foo ` and now it will be

Re: Django tutor.

2022-07-27 Thread nick washington
Cool On Wed, Jul 27, 2022, 18:19 Md Aminul Haque wrote: > Show Django Official website > > Sent from my Huawei phone > > > Original message > From: pediah wanmi > Date: Wed, Jul 27, 2022, 5:22 PM > To: django-users@googlegroups.com > Subject: Django tutor. > > I am a djongk

Re: HOW TO RUN DJANGO PROJECT

2022-07-22 Thread nick washington
How do you want my help On Fri, Jul 22, 2022, 18:08 Edward Deus Misogoro wrote: > Please help > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to

Re: Is there a function that returns common elements in multiple lists

2022-01-26 Thread Nick Farrell
>>> a = {1, 2, 3} >>> b = {2, 3, 4} >>> a & b {2, 3} On Wednesday, 26 January 2022 at 23:52:05 UTC+11 xaadx...@gmail.com wrote: > a = [1,2,3,4] > b = [3,4,5,6] > > Convert list a to set > a_set = set(a) > print(a_set.intersection(b)) > > On Wed, Jan 26, 2022, 5:47 PM Muhammad Shehzad wrote: > >>

Re: Eliminating inter-request race conditions

2022-01-08 Thread Nick Farrell
ot alter their behaviour. The value here is in showing a user that one of the fields they are in the process of editing has changed while they have had the form open, and ensuring that they do not accidentally clobber someone else's changes. Thanks for your feedback so far. Nick -- You recei

Re: Eliminating inter-request race conditions

2021-12-31 Thread Nick Farrell
d by embedding the original values into each form in the formset, it should correctly respect those values when the formset is submitted. If it's of any assistance, I can push some code and provide some examples for you to try out. The same app I am using now should be quite easy to clone

"include super" with django templates?

2021-12-30 Thread Nick Farrell
I would like to extend a django template which is used via the include macro. That is, I want to add additional output before or after what would otherwise be emitted. With the normal {% block %} syntax, it's easy to use super to follow the template heirachy similar to __mro__ - but to my

Re: Automatic subdomain for each user

2021-12-30 Thread Nick Farrell
Once you have the TLS certificates and routing working, can't you make a tiny piece of middleware which takes the hostname (provided via nginx/apache in a request header) and add an attribute on the request which corresponds to your virtual site? e.g. (dodgy untested code follows): def

Re: Eliminating inter-request race conditions

2021-12-28 Thread Nick Farrell
with this either way, if only to use internally, if there isn't general interest. cheers, Nick. On Tuesday, 28 December 2021 at 21:35:09 UTC+11 carste...@cafu.de wrote: > Hi Nick, > > maybe this is a case for optimistic locking? > Does the thread at > https://groups.google.com/d/m

Eliminating inter-request race conditions

2021-12-27 Thread Nick Farrell
Hi all. I've been using Django for quite a number of years now, in various ways. Most of the time, I find myself needing to create custom solutions to solve what appears to be a very common problem. During the Christmas downtime, I decided to scratch this itch, and am putting together what

Re: Integrate a microphone in the Django app

2021-05-24 Thread Nick Sarbicki
package to do the conversion for you e.g. https://github.com/Uberi/speech_recognition#readme - Nick ‪On Mon, May 24, 2021 at 12:40 PM ‫מוריה יצחקי‬‎ wrote:‬ > Hello everyone > I want to allow my app to receive input from a microphone > I would be happy for help on how to do this in t

How to Get Video to Play

2020-12-03 Thread Nick Sokol
Hi All, I am trying to play uploaded video on a django web app but I keep getting a white screen and audio. Does anyone know how to fix this? Also, is this a django issue or html issue? Thank you! -- You received this message because you are subscribed to the Google Groups "Django users"

Re: no-referer CSRF error occured in only Edge

2020-07-09 Thread Hella Nick
Wow Seong Gyu Choi 于2020年7月9日周四 下午9:48写道: > Django Web Page worked properly well with POST method action in Chrome, > Firefox. But No-refere CSRF error occurs only in Edge MS browser. > > I found someone with an error similar to the one below, and I used the > method I told you here but

Re: User.objects.all() only returns username

2020-07-03 Thread Hella Nick
send me your models.py and views.py RANGA BHARATH JINKA 于2020年7月3日 周五15:13写道: > Send me views.py > > On Fri, 3 Jul 2020, 12:36 pm Mohsen Pahlevanzadeh, < > m.pahlevanza...@gmail.com> wrote: > >> I don't have model.py for auth_user. >> >> On Friday, July 3, 2020 at 11:10:17 AM UTC+4:30, RANGA

Re: Can someone help me??

2020-07-02 Thread Hella Nick
index' %}" >> >> you might need to do the same with other urls >> >> >> On Thu, Jul 2, 2020 at 9:31 AM Hella Nick wrote: >> >>> class Article(models.Model): >>>> # time = datetime.datetime.now() >>>> IMG_LINK = '/stati

Re: Can someone help me??

2020-07-02 Thread Hella Nick
le.objects.filter(id__gt=self.id).order_by('id').first() > > oba stephen 于2020年7月2日周四 下午2:28写道: > Can you share your models.py? > > Like Sencer said you have to check data types where the "+" operator is > used. > > On Thu, Jul 2, 2020 at 3:55 AM Hella Nick

Re: Can someone help me??

2020-07-01 Thread Hella Nick
Dear Mir oba stephen: I deleted "volume" function,But The result is the same. Hella Nick 于2020年7月2日周四 上午10:51写道: > Dear Sencer: > > >> index > > > > >- > > There is no problem with writing this wayI don't understand why. &g

Re: Can someone help me??

2020-07-01 Thread Hella Nick
ight forward, you are using an operand "+" for two two >> data types that it can't be used on. This might be from your "volume" >> function. >> >> On Wed, Jul 1, 2020 at 9:30 AM Hella Nick wrote: >> >>> Can someone help me?? >>> &

Can someone help me??

2020-07-01 Thread Hella Nick
Can someone help me?? My project catalogue: My setttings: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'blog/templates/')] , 'APP_DIRS': True, 'OPTIONS': {

Re: Please help me out!!!!!

2020-06-03 Thread Hella Nick
请检查您的路由地址,问题就出现在那里。 meera gangani 于2020年6月3日 周三15:19写道: > Hello Django-users > > href is not working > here is my views.py file and my urls.py file > > Please Help me out!! > > Thank you in advance > -Meera > > -- > You received this message because you are subscribed to the Google Groups >

Re: pagination of a specific context in multiple context in ListView not working in django?

2020-06-02 Thread Hella Nick
Do you use Django or Django Rest Framework? Ali Ahammad 于2020年6月2日周二 上午7:51写道: > in django, i am trying to list some queries of several objects like user > lists, categoies and Post list. the homepage will be contained couple of > blocks or boxes. each box will have different query list like

Re: Model Arithmetic Operation

2020-06-02 Thread Hella Nick
- Niggers are clearly not suited for the job. Ifeanyi Chielo 于2020年6月3日周三 上午7:43写道: > Dear all, > > Hello, please can someone help me with the code to subtract 'b' from 'a' > as shown below > > > a = Soapprod.objects.aggregate(Sum('Serial_White_Guava')) > > > > b =

Re: django-tenants domain issue

2020-06-02 Thread Hella Nick
你是要部署在互联网上吗? DumbaClassics 于2020年6月3日周三 上午8:56写道: > Hello Family > > I have been following a set up documentation for django-tenants. I did all > the set-up to even create a public domain and two tenant domains. For > allowed hosts I put ["*"] , though not safe as per clinical research data >

Re: Integrate wepay payments in django site

2020-05-26 Thread Hella Nick
你应该是阿三吧? Akshat Zala 于2020年5月20日周三 上午11:32写道: > You can install the following package and study the documentation: > > 1. https://pypi.org/project/django-wepay/ > > On Tuesday, 19 May 2020 22:56:24 UTC+5:30, Shyam Acharjya wrote: >> >> greetings, >> >> has anyone here have any prior experience

Re: Getting the except django.core.exceptions.ImproperlyConfigured while querying DB

2020-05-20 Thread Hella Nick
此处有语法错误: path('display_data/', views.display_data, name= 'display_data'), 正确的写法为:path(r'^display_data//$', views.display_data, name= 'display_data/'), 请记住,一定要加 / -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: Getting the except django.core.exceptions.ImproperlyConfigured while querying DB

2020-05-20 Thread Hella Nick
如果您确定数据库中有数据的话,那么就是您该视图的url设计错误。Django数据库查询的get方法查询不到数据会报错。希望可以帮助到您。 ratnadeep ray 于2020年5月20日周三 下午4:16写道: > I am trying to fetch a few rows from the DB using the following code in my > views.py: > > from django.http import HttpResponsefrom django.shortcuts import renderfrom >

Re: Can't Fix the No Reverse Error in Ajax

2020-05-20 Thread Hella Nick
May 2020, 6:18 am Ahmed Khairy, > wrote: > >> Do you mean that this line should be changed? >> >> > 'post_id' class= "btn btn-danger btn-sm" value="{{post.id}}" >> > No ! Don't Print it >> >> On T

Re: NEW TO DJANGO

2020-05-19 Thread Hella Nick
你是阿三吗? Akshat Zala 于2020年5月20日周三 上午11:27写道: > I agree with Vishesh, You require api key which needs to be in settings.py > file > > On Tuesday, 19 May 2020 20:43:17 UTC+5:30, Vishesh Mangla wrote: >> >> Your question is not clear to me. What exactly do you want ?You do not >> require django to

Re: Can't Fix the No Reverse Error in Ajax

2020-05-19 Thread Hella Nick
Django中的表单提交按钮不要使用submit属性,否则会触发get请求,或者发生错误。 Hella Nick 于2020年5月20日周三 上午11:09写道: > button标签中的type属性设置为button, > > Ahmed Khairy 于2020年5月20日周三 上午1:54写道: > >> I am trying to use Ajax to submit a like button, I believe everything is >> in

Re: Can't Fix the No Reverse Error in Ajax

2020-05-19 Thread Hella Nick
button标签中的type属性设置为button, Ahmed Khairy 于2020年5月20日周三 上午1:54写道: > I am trying to use Ajax to submit a like button, I believe everything is > in order but I keep getting django.urls.exceptions.NoReverseMatch: Reverse > for 'like_post' with arguments '('',)' not found. 1 pattern(s) tried: >

Re: PROBLEM WITH Multiple SETTINGS.PY FILE

2020-05-19 Thread Hella Nick
你帮我获得加拿大的工作移民签证,我就可以帮你解决问题。 在 2020年5月17日星期日 UTC+8上午4:51:45,chaitan写道: > > Hi, I am facing ModuleNotFoundError in my Django application. It got > configured with multiple settings files for production, Development & > Testing. > When I Try to run Python manage.py runserver --settings=

Re: Can Django (application itself) connect to MySQL via Kerberos/GSSAPI ticket instead of password?

2020-05-19 Thread Hella Nick
Mysql8.0以上的版本更改了加密规则,这可能需要你多研究一下遇到的问题。我记得需要修改Django框架中的一些源码。 在 2020年5月20日星期三 UTC+8上午9:37:33,Edward Rose写道: > > Hello - Does Django have any support for the web application itself being > able to connect to MySQL using Kerberos Authentication / GSSAPI rather than > a hard coded database user

Django and uwsgi and nginx is log error

2020-05-08 Thread Hella Nick
我的uwsig日志显示: clock source: unix detected number of CPU cores: 2 current working directory: /project/work/teacher writing pidfile to /project/work/teacher/uwsgi.pid detected binary path: /project/env/online/bin/uwsgi !!! no internal routing support, rebuild with

Re: hosting django app on app engine

2020-04-23 Thread Nick Sarbicki
IPs are arbitrary, you cannot connect directly to the database but need to tell App Engine to load up a proxy and then connect to that instead. Sorry I can't help much more - I wish I'd written down the steps I took last I did this, but it's been too long for me to remember it well. - Nick

Re: Django pdfs

2020-04-22 Thread Hella Nick
me to。do you help me? Perceval Maturure 于2020年4月22日 周三07:31写道: > Hi Django Users > > I am developing a Django document management system which will cater for > pdf file uploads. What is the best resource to use (tutorial) as I want to > have the pdfs accessible from admin. Can I do this with

Re: keep getting the Fatal Python error with mod_wsgi and apache

2020-03-25 Thread Hella Nick
你的服务器是安装的python3.8.2的版本吗? Fateh Budwal 于2020年3月26日周四 上午6:03写道: > Hello Everyone > I have complied python 3.8.2 with django 2.2. it run locally fine but > when i try to deploy it with Apache and mod_wsgi 4.7.1 and getting the > below error. Any suggestions ? > > Current thread

Re: Django IRC...Is it Active?

2020-03-20 Thread Nick Sarbicki
If you are just looking for help the #django channel on the python developers slack workspace (pyslackers.com) is pretty active. Full disclosure - I'm an admin of the slack workspace. - Nick On Fri, Mar 20, 2020 at 2:14 PM Andréas Kühne wrote: > Currently the django project recommends us

Re: relation "django_session" does not exist

2020-02-26 Thread Hella Nick
Me to,My error was is Traceback (most recent call last): File "D:\Python3\lib\site-packages\django\contrib\sessions\backends\base.py", line 190, in _get_session return self._session_cache AttributeError: 'SessionStore' object has no attribute '_session_cache' During handling of the above

Re: Running 2.7 python project with python 3.7

2020-02-13 Thread Nick Sarbicki
does not work in 3.7, your options are to rewrite the code so that it does. - Nick On Thu, Feb 13, 2020 at 9:54 AM Luka Nik wrote: > Is there a way to run a project with python 3.7 if it's written with > python 2.7? > And what are my options if not? > Cheers, > Luka > &

Re: Getting the first item in a dict

2020-01-27 Thread Nick Sarbicki
in the dict. Although it is worth noting this will also remove that item from the dict (giving you a single non-nested dict which seems more desirable). - Nick On Mon, Jan 27, 2020 at 12:32 PM Mike Dewhirst wrote: > Can you use ddict[ddict.keys()[0]] ??? > > I don't know if that would

Re: Hosting a django website

2020-01-26 Thread Nick Sarbicki
It depends on the shared host. Shared hosts generally only have installed a set of standard tools which they decide on. This may or may not include things like python (2 or 3) and other requirements you need. A lot of the time as a result it does not prove possible to run a Django site on shared

Re: Best Django Deployment

2020-01-25 Thread Nick Sarbicki
i user Nginx/Gunicorn or Nginx/uwsgi ?? are there any > performance gain ? > > What about running Django in an Asynchronous way , i mean using django > with Asgi rather than Usgi ?? any performance gain too ?? > > On Sat, Jan 25, 2020 at 1:09 PM Nick Sarbicki > wrote: > >> I'v

Re: Best Django Deployment

2020-01-25 Thread Nick Sarbicki
I've used nginx+gunicorn/uwsgi, Apache+modwsgi, Google app engine flex, Google app engine standard, heroku, kubernetes on various cloud platforms, elastic beanstalk deployments and various others. Realistically I don't think there is a "best" way. It all depends on your environment, what you're

Re: djangorestframework vs GraphQL

2019-11-12 Thread Nick Sarbicki
data) doesn't enthuse me. It's an interesting solution to a problem I've never really had. Not to say it isn't useful in some situations, I just haven't yet encountered a situation where it is. - Nick On Tue, Nov 12, 2019 at 9:14 AM guettli wrote: > Hi, > > I am new to GraphQL, b

Re: How t do Login using Gmail, twtter or facebook

2019-11-11 Thread Nick Sarbicki
/providers.html#google - Nick On Mon, Nov 11, 2019 at 9:32 AM Andréas Kühne wrote: > > https://simpleisbetterthancomplex.com/tutorial/2016/10/24/how-to-add-social-login-to-django.html > > Regards, > > Andréas > > > Den mån 11 nov. 2019 kl 10:27 skrev Balaji Shetty >: &g

Re: Microservice with django

2019-11-08 Thread Nick Sarbicki
There is not really anything that requires doing to make Django work with microservices or as a microservice. It is completely agnostic to your overall architecture. Just simply create a new django project for each microservice you want to create. There honestly is nothing else to it. - Nick

Re: Django Rest Framework and Django allauth

2019-10-15 Thread Nick Sarbicki
custom solutions is not that time consuming. But if it's more basic authentication it should be fine. - Nick On Tue, Oct 15, 2019 at 12:06 PM Joseph Emeka wrote: > Can i use Django rest framework and Django allauth in the same project or > either of then at a time. Am building a p

Re: Docker

2019-10-14 Thread Nick Sarbicki
gards > Vineet Daniel > Cell : +918527565696 > Websites : Blog <http://vineetdaniel.blogspot.com> | Linkedin > <http://in.linkedin.com/in/vineetdaniel> | Twitter > <https://twitter.com/vineetdaniel> > > > > > On Mon, Oct 14, 2019 at 2:40

Re: Docker

2019-10-14 Thread Nick Sarbicki
om> | Linkedin > <http://in.linkedin.com/in/vineetdaniel> | Twitter > <https://twitter.com/vineetdaniel> > > > > > On Thu, Oct 10, 2019 at 10:13 PM Nick Sarbicki > wrote: > >> Don't use git inside the container, this is not the standard way of doi

Re: Docker

2019-10-10 Thread Nick Sarbicki
Don't use git inside the container, this is not the standard way of doing things. Docker has its own guide for using django with compose. This works fine for a single server setup: https://docs.docker.com/compose/django/ - Nick On Thu, Oct 10, 2019 at 5:09 PM vineet daniel wrote: > Use

Can Django support chunked file uploads without a Content-Length header?

2019-10-02 Thread Nick Sarbicki
I'm working on a Django API which receives audio files and some extra POST data and then processes the file. This was initially in Flask, but Django suits the overall project better so we're migrating. However we've run into a snag. Currently the audio file is sent via node.js, with the

Re: best option for Front End Design in Django

2019-09-26 Thread Nick Sarbicki
comparable. There are multiple ways of approaching converting a website into an app but most are relatively advanced. I would focus on what you are doing now before thinking about that journey. - Nick On Thu, Sep 26, 2019 at 11:50 AM Pengyu Cao wrote: > Hey, how about check this, >

Re: convert python 3 to python2

2019-09-24 Thread Nick Sarbicki
I'm not convinced anyone could pay me enough to go back to Python 1... On Tue, Sep 24, 2019 at 1:32 PM Larry Martell wrote: > You can get anyone to do anything for enough money. > > On Tue, Sep 24, 2019 at 8:30 AM Deep Sukhwani > wrote: > > > > Thanks for the prompt reply. Did a quick cursory

Re: Slack community for Django

2019-07-17 Thread Nick Sarbicki
Cheers for the feedback Deep, Sadly given the scale of the current community it would cost up to around 1.6 million USD per year to use enterprise slack. I know some OSS communities have this enabled for free, slack has been approached about this but have sadly declined to give pyslackers the

Re: Slack community for Django

2019-07-17 Thread Nick Sarbicki
Hi Deep, I'm not sure if there is currently a dedicated django community (there was an unofficial one but I believe it was converted into the yellow ant community). We do however have a dedicated python community with a very active Django channel. It's linked on the PSF site here:

Re: Deploying a static website

2019-07-04 Thread Nick Sarbicki
The best way to deploy a static website is certainly on a bucket like s3. Heroku is massive overkill for this. Django is also unnecessary to host a static website. I do have a CMS that generates and uploads static websites built with Django, but not django actually hosting the site. On Thu, 4

Re: advantage of angular js with django??

2019-06-01 Thread Nick Sarbicki
> The biggest advantage is you can create, change or have multiple frontend systems on different platforms without having to make changes to your Django backend. For example you can create an AngularJS web app and a React Native app for iOS using the same Django backend. It's worth noting that

Re: how i can become django master ?

2019-05-31 Thread Nick Sarbicki
https://docs.djangoproject.com/en/2.2/intro/overview/ - Nick On Fri, May 31, 2019 at 12:10 PM soroush safari wrote: > hello guys. where I need to start reading Django and her reference? > > -- > You received this message because you are subscribed to the Google Groups > "

Re: set python 3.6.8 default in my ubuntu

2019-05-22 Thread Nick Sarbicki
s some documentation on this here <https://devcenter.heroku.com/articles/python-runtimes>. - Nick On Wed, May 22, 2019 at 1:48 PM omar ahmed wrote: > hello .. > just finished my first project with django but i can not publish it > because my default python is python 2.7.12 and Heroku

Re: How to make Django Project Mobile Compatible

2019-05-11 Thread Nick Sarbicki
Hi, Django is completely naive to whether a frontend is mobile friendly or not. You can use react or angular, you can also use many other frontend frameworks. Django can work with all frontend frameworks. The choice is entirely up to you. On Sat, 11 May 2019, 08:04 Balaji Shetty, wrote: > Hi

Re: Website slowed down drasticaly

2019-05-06 Thread Nick Sarbicki
Hi Saurabh, If the diminishing support was a cause of the dramatic slowdown then this would have had to be intentionally put into the codebase. I'm almost certain this isn't the case. All losing support really means is that the developers no longer provide updates and security patches. There

Re: Website slowed down drasticaly

2019-05-03 Thread Nick Sarbicki
will help you profile the code but worth seeing how it is served as well. - Nick On Fri, May 3, 2019 at 10:21 AM Chetan Ganji wrote: > One more thing - > > All the third party resources i.e. js and css files e.g. bootstrap, > jquery, etc; don't fetch them from your server. > Us

Re: Which Cloud Service Provider should be chosen to host Django Application

2019-05-02 Thread Nick Sarbicki
what price/feature set/level of expertise required suits you best. - Nick On Thu, May 2, 2019 at 10:51 AM Balaji Shetty wrote: > Hi > > I do not have any experience for cloud hosting. Can you please suggest > Cloud Service Provider to host Django Application. > > My Applica

Re: Django with Docker

2019-04-29 Thread Nick Sarbicki
Hi Omer, Docker actually has docs on this itself: https://docs.docker.com/compose/django/ - Nick On Mon, Apr 29, 2019 at 4:19 PM Omer Ozsakarya wrote: > Hello all, > > How are you deploying your Django applications with Docker? > 1- Which packages, libraries are you writing

Re: help

2019-04-29 Thread Nick Sarbicki
/howto/custom-template-tags/#simple-tags - Nick On Mon, Apr 29, 2019 at 3:14 PM Tosin Ayoola wrote: > sup guys, i'm kinda lost and need help, i'm working on an electronic > noticeboard and course ware web app using django and i'm trying to have a > section on the notice board to show t

Re: Converting django app to iPhone app

2019-04-22 Thread Nick Sarbicki
22 Apr 2019, 17:28 Larry Martell, wrote: > Yes, it only renders HTML and also has a lot of javascript. > > On Mon, Apr 22, 2019 at 12:25 PM Nick Sarbicki > wrote: > > > > That's the point, you don't. Assuming your backend has an effective way > of delivering data (e.g

Re: Converting django app to iPhone app

2019-04-22 Thread Nick Sarbicki
swift or rewrite > the entire app in objective C or swift. Why would you need to rewrite > the python back end that runs on the server? > > On Mon, Apr 22, 2019 at 10:27 AM Nick Sarbicki > wrote: > > > > Kind of... > > > > I've worked with several Django APIs

Re: Converting django app to iPhone app

2019-04-22 Thread Nick Sarbicki
Kind of... I've worked with several Django APIs that we use to back apps on Android and iOS as well as web apps. I generally find that's the key, make sure you can pass all the data along as an API and the rest is just understanding how to build a frontend on the platform. Django doesn't really

Re: Accessing child relations when overriding save()

2019-02-10 Thread Nick Emery
UPDATE: Finally figured it out! I ultimately did this by overriding `perform_create()` in my [Django Rest Framework view](https://www.django-rest-framework.org/api-guide/generic-views/) and making my changes after saving the object. On Sunday, February 10, 2019 at 8:34:44 AM UTC-5, Nick Emery

Re: Accessing child relations when overriding save()

2019-02-10 Thread Nick Emery
e: > >> When do you create child objects?? >> >> On Sun, 10 Feb, 2019, 9:17 PM Nick Emery > wrote: >> >>> Tried this too but save() never actually gets called on the child (it >>> seems that the foreign key field of the child is updated at the dat

Re: Accessing child relations when overriding save()

2019-02-10 Thread Nick Emery
e save() of the child? > > On Sun, 10 Feb, 2019, 7:04 PM Nick Emery > wrote: > >> I am trying to wrap up my first app using Django (specifically Django >> Rest Framework which may change the save behavior), but have run into an >> issue that I haven't been able to solv

Accessing child relations when overriding save()

2019-02-10 Thread Nick Emery
I am trying to wrap up my first app using Django (specifically Django Rest Framework which may change the save behavior), but have run into an issue that I haven't been able to solve for about 10 hours now. I am trying to override the save() method of a model to modify a field on a bunch of

Re: Limiting a SubQuery based on instance's OuterRef

2019-01-30 Thread Nick Gashkov
Simon, Thank you for fast reply! I've tried to rewrite a query using RowNumber()... inner_subquery = queryset.objects.filter(date__gte=today, day_type='working_day') inner_subquery = inner_subquery.annotate(row_number=Window(expression=RowNumber(), order_by=F('number').asc())) inner_subquery

Limiting a SubQuery based on instance's OuterRef

2019-01-29 Thread Nick Gashkov
Hello there! Is it possible to limit a SubQuery to a dynamic value of an instance in a QuerySet? I.e. I'm looking for something like: queryset = model.objects.filter(field=OuterRef('field')).values('another_field')[:OuterRef('number')] Sincerely, Nick Gashkov -- You received this message

Re: Nullable vs empty strings

2018-05-03 Thread Nick Sarbicki
:32 PM UTC+1, Jani Tiainen wrote: > > And then you find out that Oracle implicitly converts empty strings to > NULLs which causes all kind of hassle. :) > > > On Thu, May 3, 2018 at 3:39 PM, Ken Whitesell <kenwhi...@comcast.net > > wrote: > >> Nick, >>

Nullable vs empty strings

2018-05-03 Thread Nick Sarbicki
I just saw this in the docs: https://docs.djangoproject.com/en/2.0/ref/models/fields/#null Suggesting that you should never set a CharField to null unless using a unique index. Is this generally accepted? Historically I've always nulled a CharField because using empty strings, as opposed to

Re: Django won't update when i restart httpd.service on Fedora 23 virtual machine

2018-03-10 Thread Nick Saway
. On Saturday, March 10, 2018 at 2:57:51 PM UTC-7, Nick Saway wrote: > > HI, I have a Django site running on a Fedora 23 virtual machine via > Apache, i believe it is using mod_wsgi. I updated the site files, and did > "systemctl stop httpd.service " and "sy

Django won't update when i restart httpd.service on Fedora 23 virtual machine

2018-03-10 Thread Nick Saway
HI, I have a Django site running on a Fedora 23 virtual machine via Apache, i believe it is using mod_wsgi. I updated the site files, and did "systemctl stop httpd.service " and "systemctl start httpd.service" but the old version of the site is still being served. I went into my project

Re: javascript transpilers

2018-01-29 Thread Nick Sarbicki
>> Jani asked what problem I need to solve. Without going into analytical >> detail, all the code is serverside and now the project needs to move >> towards AJAX for user experience reasons. >> >> M >> >> On 29/01/2018 5:44 AM, Nick Sarbicki wrote: >>

Re: javascript transpilers

2018-01-28 Thread Nick Sarbicki
Agree with everything already said. Only thing I want to add is that while js has historically been a horrible language, the modern standards have helped rectify this. Modern js can be almost pleasant to work with nowadays. I wouldn't spend time transpiling python to js. Just try to learn js and

Re: django 2 under python 2

2018-01-25 Thread Nick Sarbicki
Looks like a pypi "feature". You should pin your dependencies. On Fri, 26 Jan 2018, 00:08 Mirek Zvolsky, wrote: > Isn't the question a little oposite, Avraham ?? > > > > Dne čtvrtek 25. ledna 2018 22:42:37 UTC+1 Avraham Serour napsal(a): >> >> > I wonder why this is

Re: [python-uk] Setting up Django on Google Cloud (basic server)

2018-01-25 Thread Nick Sarbicki
There was a discussion on a slack channel a few days ago with someone who, suspiciously, had the same name and problem. They'd tried to set up firewall rules (not sure they worked) and was trying to get it running via port 80 with gunicorn. Haven't heard anything else so assuming fixed. On Thu,

Re: Will django include a simpler way to change username to email for registration in the future ?

2018-01-24 Thread Nick Sarbicki
django allauth (http://django-allauth.readthedocs.io/en/latest/overview.html) also has a pretty good setup for this as well as a lot of other functionality. As suggested it just takes a change in settings.py to move to email as username (although it isn't stored that way in the DB that is how it

Re: Setting up Django on Google Cloud (basic server)

2018-01-20 Thread Nick Sarbicki
Hi Samuel, You probably haven't opened access to port 8000 to the public Try run server on port 80. Nick. On Sat, 20 Jan 2018, 14:53 Samuel Muiruri, <muiruri.sam...@gmail.com> wrote: > I had this issue before with AWS i remember it was just as stressful then > and actually can't r

Error when creating a django app in a specified folder with the same name as the app

2017-12-19 Thread Nick Gilmour
: $ mkdir backend/apps/my_app $ python manage startapp my_app ./backend/apps/my_app Is this normal? Any ideas why is this happening? Regards, Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Django+Haystack+Elastic issue

2017-05-25 Thread Nick Gilmour
increased it to 50 and I'm getting 50 hits. On Thu, May 25, 2017 at 12:06 AM, Nick Gilmour <nickefo...@gmail.com> wrote: > Thanks for the hint! > It seems to be related with Django's pagination: > with: > {{ page.paginator.count }} > and > {{ page.paginator.num_pages }} &g

Re: Django+Haystack+Elastic issue

2017-05-24 Thread Nick Gilmour
works... On Wed, May 24, 2017 at 4:55 PM, Avraham Serour <tovm...@gmail.com> wrote: > it sounds like elastic is paginating, did you check that? > > On Tue, May 23, 2017 at 12:41 AM, Nick Gilmour <nickefo...@gmail.com> > wrote: > >> Hi all, >> >> &

Django+Haystack+Elastic issue

2017-05-22 Thread Nick Gilmour
give more than 50 results. So, where does this limitation come from? How can I change it? I cannot find a setting neither for haystack nor for django which prevents showing more than 20 results. Thanks, Nick -- You received this message because you are subscribed to the Google Groups

Re: View Function Signature?

2017-05-14 Thread Nick Gilmour
> > Neither one of these is what was being asked for. I didn't say I have found what I was looking for. All answers are sufficient to me for now. Thanks. On Sun, May 14, 2017 at 10:51 PM, James Bennett <ubernost...@gmail.com> wrote: > On Sun, May 14, 2017 at 1:36 PM, Nick G

Re: View Function Signature?

2017-05-14 Thread Nick Gilmour
Definition of url: *def url(regex, view, kwargs=None, name=None):* I also found this: *def view(request, *args, **kwargs):* here: *.../django/views/generic/base.py* On Sat, May 13, 2017 at 11:15 PM, Daniel Roseman wrote: > On Friday, 12 May 2017 15:11:55 UTC+1,

Re: View Function Signature?

2017-05-12 Thread Nick Gilmour
Thanks for the link. I understand these examples but still I would like to see how a view function is defined. I also would like to see it in PyCharm. When I click on a view function in PyCharm I only see: def myview_function(request) Inferred type: (request: Any) -> HttpResponse I would expect

Re: HELP - Writing your first Django app, part 1

2016-10-16 Thread 'Nick Bansal' via Django users
Cheers! got it! On Friday, 14 October 2016 22:45:05 UTC+1, Asad Jibran Ahmed wrote: > > Just save the file inside the *poll *folder. That creates the file. > > Asad Jibran Ahmed <surf...@gmail.com > > http://blog.asadjb.com > > On Fri, Oct 14, 2016 at 9:55 PM, 'Ni

Re: HELP - Writing your first Django app, part 1

2016-10-14 Thread 'Nick Bansal' via Django users
if you're looking for options) and save the file as urls.py > inside the polls directory. > > Asad Jibran Ahmed <surf...@gmail.com > > http://blog.asadjb.com > > On Fri, Oct 14, 2016 at 8:00 PM, 'Nick Bansal' via Django users < > django...@googlegroups.com > wrote: &g

HELP - Writing your first Django app, part 1

2016-10-14 Thread 'Nick Bansal' via Django users
Hi, I'm struggling to figure out how to do the following command: "To create a URLconf in the polls directory, create a file called urls.py. Your app directory should now look like:" How do I create a file called urls.py in the app directory? am I missing something completely obvious? Any

Re: Advice on python version for new project

2016-08-15 Thread Nick Santos
ething that forces you to use Python 2, you can downgrade without trouble. But if this application has anything close to the lifespan of the previous one, you'll want to be using Python 3 if at all possible. That's without mentioning the other benefits of Python 3 too! -Nick <n...@envirocon

Possible bug with UploadedFile and form validation?

2016-06-13 Thread Nick Sarbicki
I've got an odd bug in my system, and while I'm not 100% convinced it is a Django bug, I don't think it is due to me either so thought I'd ask here for some clarification. Essentially if you upload a file to a form. If that forms clean() method reads that file (in my case it gathers data and

Deploying a Django 1.9 project

2016-04-12 Thread Nick Jenkins
I've been developing a site with Django 1.9 with Python3 and I'm hitting a wall when trying to deploy it to a hosting service. I currently have a shared service plan through BlueHost and I'm having trouble getting everything to work right. In talking with BlueHost they stated they only support

Re: how to create a project in django in windows 7

2015-09-15 Thread Nick Sarbicki
send any error messages you receive. Here are the formal instructions to install Django: https://docs.djangoproject.com/en/1.8/intro/install/ And here is the tutorial for getting started on a project: https://docs.djangoproject.com/en/1.8/intro/tutorial01/ They are both pretty good so give them

  1   2   3   4   5   6   7   >