Re: Finding the last modified timestamp for a group of Models

2024-02-28 Thread Jason
https://docs.djangoproject.com/en/5.0/ref/applications/#django.apps.AppConfig.get_models gets you an iterable of all models loaded On Tuesday, February 27, 2024 at 8:53:32 AM UTC-5 Alex Guetsche wrote: > I have an application which contains more than one Model, all descended > from an abstract

Re: Data model design questio: graph in database

2024-02-25 Thread Jason
Question about this, why focus on using a rdbms for this functionality vs using an actual graph db like neo4j with neomodel ? On Sunday, February 25, 2024 at 7:59:31 PM UTC-5 Mike Dewhirst wrote: > Re-reading your question perhaps I was too

Re: Question about `_meta` API's naming

2024-02-21 Thread Jason
https://forum.djangoproject.com/ would be a better place to ask, FYI. as far as why keep private... lets flip it around. Why make it public? what's the benefit of this change? Having it private means that the API internals can change if necessary On Tuesday, February 20, 2024 at 10:15:43 AM

Re: Django 4.2, PyPy and Postgres

2023-12-12 Thread Jason
t been thoroughly tested > but my test suite passes, which is very encouraging. > > Thanks for the nudge, Jason. > > On Tuesday, December 12, 2023 at 10:51:29 AM UTC-5 Pete Doherty wrote: > >> I did try using psycopg2-binary and the app wouldn't start. I'll have to >> r

Re: Django 4.2, PyPy and Postgres

2023-12-11 Thread Jason
the last release of psycopg2cffi was January 2021 pypy support for 3.10 came out Dec 2022 Is there a reason you're on psycopg2cffi? have you tried with regular psycopg2? On Monday, December 11, 2023 at 3:19:11 PM UTC-5 Pete Doherty wrote: > I'm wondering if anyone is using Django 4.2, PyPy

Re: Dynamic Table

2023-05-24 Thread Jason
I hope you can understand the security implications of this and are knowledgeable on the places where you need to lock down access. On Wednesday, May 24, 2023 at 6:47:14 AM UTC-4 Helly Modi wrote: > we have to create this project where user can enter all details of table > from frontend and

Re: Annotate and Subquery with 2 tables in 2 different databases

2023-04-20 Thread Jason
this won't work, you're doing things across two entire dbs. So you'l have to implement all the logic in python to execute. On Thursday, April 20, 2023 at 9:58:20 AM UTC-4 Mạnh ĐỖ wrote: > I want to use annotate and subquery to join tables. > Table1 in database1 and table2 in database2. But

Re: Migration running in shell, but no change in DB

2023-04-06 Thread Jason
you said you have a router.py file in your project? put it in there. On Thursday, April 6, 2023 at 10:50:15 AM UTC-4 Martin Heitmann wrote: > Dear Jason > > db per project/app: Okay, I will keep that in mind for the future. I just > thought that it would be a cleaner way when eac

Re: Migration running in shell, but no change in DB

2023-04-05 Thread Jason
logging there, or raise an exception ie, logger.info("db does not match db app name"), or raise Exception("db does not match app name") On Wednesday, April 5, 2023 at 12:45:01 PM UTC-4 Martin Heitmann wrote: > Dear Jason > > Thanks for all your effort. > >

Re: Migration running in shell, but no change in DB

2023-04-05 Thread Jason
ons for the model_name will be silently skipped when running migrate on the db. * On Wednesday, April 5, 2023 at 1:52:12 AM UTC-4 Martin Heitmann wrote: > Dear Jason > > Thanks for your reply. I am not absolulety sure what this question means > "What specifically was the

Re: Migration running in shell, but no change in DB

2023-04-04 Thread Jason
 AM UTC-4 Martin Heitmann wrote: > Would you recommend using inspectdb? > > On Monday, April 3, 2023 at 1:58:55 PM UTC+2 Martin Heitmann wrote: > >> Dear Jason >> >> What could I do to get it back in sync? I tried several recommendations >> from the web, but

Re: Migration running in shell, but no change in DB

2023-04-01 Thread Jason
part of getting effective help is sharing how you're doing things and the code. for example, sharing the migration generated would be helpful. you do have the context of how and what is being executed, we don't, so sharing that with your original questions is a big part in getting effective

Re: django model method

2023-02-13 Thread Jason
there's alot to not like about the implementation here. You're effectively hiding queries and db hits with those methods, since the naming does not give any indication that its a db hit. So its really easy to forget that, and then after a while, you're wondering why your project is so slow

Re: Django .values() / SQL table fields wildcards

2023-02-04 Thread Jason
Seems to me case-when and conditional expressions[0] would be a better fit for you. Django selects all the fields of the models, except when values and values_list are used to specify the fields. however, those methods do not populate model instances, because why woould they? they only have

Re: MySQL table is missing ON DELETE CASCADE constraint

2023-01-24 Thread Jason
> > On 20/01/2023 20:15, Jason wrote: > > > https://docs.djangoproject.com/en/4.1/ref/models/fields/#django.db.models.CASCADE > > > > Django emulates the behavior of the SQL constraint ON DELETE CASCADE and > also deletes the object containing the ForeignKey

Re: MySQL table is missing ON DELETE CASCADE constraint

2023-01-20 Thread Jason
https://docs.djangoproject.com/en/4.1/ref/models/fields/#django.db.models.CASCADE > Django emulates the behavior of the SQL constraint ON DELETE CASCADE and also deletes the object containing the ForeignKey. this is specified in the docs. https://code.djangoproject.com/ticket/21961 On

Re: AttributeError: 'QuerySet' object has no attribute 'mime_type'

2023-01-19 Thread Jason
is `content` a queryset? On Thursday, January 19, 2023 at 8:21:39 AM UTC-5 monisha.s...@ideas2it.com wrote: > @staticmethod > def post(request, *args, **kwargs): > constant = utils.send_grid_key > sg = SendGridAPIClient(constant) > subject = get_subject() > content = get_content() > message =

Re: How to fetch 10000 above record within second in django?

2023-01-18 Thread Jason
https://dev.mysql.com/doc/refman/8.0/en/using-explain.html is a good guide to showing how to use EXPLAIN to see what your query is running. https://use-the-index-luke.com/ is a great introductory source for indexes https://django-debug-toolbar.readthedocs.io/en/latest/ added to your project

Re: How to access the value of a field that failed validation

2023-01-03 Thread Jason
you'll need to implement custom validators to override the default `ValidationError` message for the fields. some fields include this functionality by default, ie DecimalField ( https://github.com/django/django/blob/main/django/forms/fields.py#L419-L428), others don't On Monday, January 2,

Re: Apache2 hates my Django deployment method

2022-12-11 Thread Jason
in all the processes in that list that is still busy or stuck somehow. On Sunday, December 11, 2022 at 5:45:40 PM UTC-5 Mike Dewhirst wrote: > On 12/12/2022 1:33 am, Jason wrote: > > AFAIK, restarting apache process on deployment is standard, is there a > reason yo

Re: Apache2 hates my Django deployment method

2022-12-11 Thread Jason
AFAIK, restarting apache process on deployment is standard, is there a reason you don't want to do that? Templates are picked up because they're not evaluated and compiled, rather they're processed dynamically so any changes there do not require a restart. On Saturday, December 10, 2022 at

Re: Need to Replace django default I'd with UUID field

2022-11-22 Thread Jason
why? use uuid for public resource access, and internal int/bigint for primary keys. that works well with the index structure and doesn't leak sequential information out by URLs. in other words, a resource is accessed via `somesite.com/some-resource/ internally, you do a lookup like

Re: Need to Replace django default I'd with UUID field

2022-11-22 Thread Jason Turner
I would just add another column that holds the UUID value instead of changing the default ID. On Tue, Nov 22, 2022, 12:55 PM Rajesh Kumar wrote: > Hi everyone! > Hope everyone is doing well... > > Actually I have 100+ existing data in my database with default I'd field > of django > Now I need

Re: serving 206 Byte-Range during development

2022-09-05 Thread Jason
use gunicorn or uwsgi with autoreload https://docs.gunicorn.org/en/latest/settings.html?highlight=reload#reload https://uwsgi-docs.readthedocs.io/en/latest/Snippets.html?highlight=autoreload#python-auto-reloading-development-only On Monday, September 5, 2022 at 5:22:01 AM UTC-4 vjwork wrote: >

Re: Understanding schema editor()

2022-08-19 Thread Jason
Documentation for add field implementation of add_field postgres schema editor

Re: DRF question

2022-07-23 Thread Jason
is outside the frameworks, and then have your separate handlers call that thing as part of their flow. On Saturday, July 23, 2022 at 1:04:52 PM UTC-4 ram.mu...@gmail.com wrote: > Hi Jason, > > Thank you for your email. I expected DRF could be an extensible feature > rather than forcing to change e

Re: DRF question

2022-07-23 Thread Jason
Ram, what did you expect, to be honest? Going from forms to rest are two different implementation details for the same concept. When you do such things, you need to evaluate whether the tradeoffs are worth it. On Saturday, July 23, 2022 at 1:30:43 AM UTC-4 ram.mu...@gmail.com wrote: > Hi

Re: Does Django care about max_query_params? [feature request]

2022-07-05 Thread Jason
python-spanner-django > > On Tuesday, June 28, 2022 at 11:36:08 AM UTC+4 Jason wrote: > >> >> What db are you using? This might also be an issue for your db connector >> lib >> On Monday, June 27, 2022 at 10:49:40 AM UTC-4 gurov...@gmail.com wrote: >> >&

Re: upgrading from 1.11 and ran into builtin permission clash

2022-07-01 Thread Jason
Joel Goldstick, would definitely not recommend doing an all in one update. That'd be like going from windows XP to 10 in one go. For personal projects, you could do it, but would side-eye any professional who suggested doing this with a company or workplace project.

Re: How to ignoring columns on model save

2022-06-28 Thread Jason
https://code.djangoproject.com/ticket/21454 there's an open ticket about this, some things might help you there. But right now, there's no easy way to get around this On Monday, June 27, 2022 at 5:36:50 AM UTC-4 ro...@tonic-solutions.com wrote: > I have a model that is backed by a database

Re: Does Django care about max_query_params? [feature request]

2022-06-28 Thread Jason
What db are you using? This might also be an issue for your db connector lib On Monday, June 27, 2022 at 10:49:40 AM UTC-4 gurov...@gmail.com wrote: > Hi, all! > > Gotta problem with the number of query params. We're using a backend, > which connects to a cloud database, and at some point we

Re: Suggestion for prefetch_related() documentation

2022-06-24 Thread Jason
This is explicitly called out in the documentation at https://docs.djangoproject.com/en/4.0/topics/db/optimization/#understand-queryset-evaluation On Thursday, June 23, 2022 at 1:17:50 PM UTC-4 laurent...@gmail.com wrote: > Hello, > > I made a simple test to check the number of queries done :

Re: How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts?

2022-06-06 Thread Jason
Why? what's the purpose behind this? On Monday, June 6, 2022 at 12:27:58 PM UTC-4 cseb...@gmail.com wrote: > How replace "./manage.py < some_code.py" with "./some_code.py" for website > scripts? > > There seem to be a number of imports needed to make the 2nd version work. > > cs > -- You

Re: Best approach for audit logging in Django.

2022-06-03 Thread Jason
one good source when you have a question "is there anything in django that does X?" is to go to djangopackages.org. https://djangopackages.org/grids/g/model-audit/, for example, is a list of packages for model auditing and history On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com

Re: How can I work around the Django 3.2.10 cve release

2022-05-21 Thread Jason
https://docs.djangoproject.com/en/4.0/ref/urls/#django.urls.path This was one of the additions in 2.0, and from what it seems like, you're not doing anything specific with regex that cannot be done with a path alternative. ie, re_path(r"invoice/(?P\d+)/$", billing_views.invoice_view,

Re: How can I work around the Django 3.2.10 cve release

2022-05-20 Thread Jason
are you using re_path for the url in question? you can see the backport change here : https://github.com/django/django/commit/d4dcd5b9dd9e462fec8220e33e3e6c822b7e88a6 On Thursday, May 19, 2022 at 11:14:25 PM UTC-4 Mike Dewhirst wrote: > My billing (Stripe) mechanism is working right up until

Re: How to construct nested QuerySet with django ORM?

2022-05-15 Thread Jason
this is a big part of what DRF brings to the table that "traditional" django doesn't have. https://www.django-rest-framework.org/api-guide/relations/ On Sunday, May 15, 2022 at 4:05:02 PM UTC-4 954i...@gmail.com wrote: > It's too inconvenient to paste the code in the email, I'll just copy a

Re: Django 3.0 -> 3.1 performance degradation

2022-05-07 Thread Jason
also would be helpful if you could give some examples. All that is stated is "there's a significant slowdown", but nothing where or if there's been any tracing in place. Is this happening with db queries? serializing? rendering? are you using old packages which might have open/closed

Re: Filtering by custom UUIDField got broken with Django 3.2 upgrade

2022-05-05 Thread Jason
and curious why the change in this behavior vs using the db's native uuid type directly On Thursday, May 5, 2022 at 7:27:02 AM UTC-4 Jason wrote: > when you print the query executed, what is the difference between a > working query and the current one? > > On Wednesday, May 4, 2022

Re: Filtering by custom UUIDField got broken with Django 3.2 upgrade

2022-05-05 Thread Jason
when you print the query executed, what is the difference between a working query and the current one? On Wednesday, May 4, 2022 at 11:14:02 AM UTC-4 bmila...@gmail.com wrote: > Hello Django users, > > I've recently upgraded the Django version from 2.2 to 3.2 in a project at > work. In this

Re: SMTPConnectError

2022-04-24 Thread Jason
how many emails are you sending out like this? this really isn't a django or python issue, its a gmail/google concern and is tied to using this pretty heavily over other services (mailgun, sendgrid, etc) On Saturday, April 23, 2022 at 7:26:09 PM UTC-4 otuwi...@gmail.com wrote: > Hello guys, >

Re: problem in reloading project files with UWSGI for Django app

2022-04-22 Thread Jason
restart uwsgi? On Friday, April 22, 2022 at 6:59:28 AM UTC-4 agnese.c...@gmail.com wrote: > Good morning, today i am facing some issues with my django app at > word-b.com. > The backend is giving me 404 on a reste resource that i have just fixed. > I have uploaded the files in production just

Re: String Concatenate

2022-04-20 Thread Jason
https://tapadoo.com/what-every-programmer-should-know-about-phone-numbers/ might be useful On Wednesday, April 20, 2022 at 1:44:38 PM UTC-4 shahee...@gmail.com wrote: > > > On Wed, 20 Apr 2022, 11:05 Kasper Laudrup, wrote: > >> On 20/04/2022 11.33, Ankit Chaurasia wrote: >> > from django.db

Re: Report to security@ bounced as "spam"

2022-03-26 Thread Jason
this might be good to report to https://groups.google.com/g/django-developers, both the security issue and spam reception. If you sent the mail from the brainonfire.net domain, might be worth checking your spam configuration. Spamhaus shows no issues, so curious why this happened. On

Re: Recreation of foreign key constraints when changing type of referenced primary key

2022-03-22 Thread Jason
You might want to ask this at https://groups.google.com/g/django-developers, as that is where the framework devs have their discussions. This is more of a users group, and I think you'll get a faster answer by posting there. On Tuesday, March 22, 2022 at 6:20:41 AM UTC-4 Gregor Jerše wrote: >

Re: What methods are available to determining display type & screen dimensions for dynamic formatting of Django templates.

2022-03-17 Thread Jason
It does seem like you're looking for something related to analytics, ie Google Analytics or one of the alternatives. On Thursday, March 17, 2022 at 5:52:14 AM UTC-4 Django2021 wrote: > Increasingly we are finding the need to have reactive Django templates, in > order to present cross platform

Re: The session doesn't seem to expire after the browser is closed

2022-03-10 Thread Jason
do you also set SESSION_COOKIE_AGE? https://stackoverflow.com/questions/9267957/is-there-a-way-to-combine-behavior-of-session-expire-at-browser-close-and-sessio/9290334#9290334 On Tuesday, March 8, 2022 at 10:43:06 AM UTC-5 hamza...@gmail.com wrote: > I'm trying to clear the expired sessions

Re: What replaced is_ajax() is django 4

2022-02-24 Thread Jason
Reason why: https://code.djangoproject.com/ticket/30997 https://groups.google.com/d/msg/django-developers/F8F5b1kEA34/FhqCmRw9BwAJ Documentation in release notes: https://docs.djangoproject.com/en/4.0/releases/3.1/#id2 On Thursday, February 24, 2022 at 2:09:13 AM UTC-5 ezra...@gmail.com wrote:

Re: UNIQUE constraint failed: matrixapp_bookplot.user_id

2022-02-05 Thread Jason
A bit of a hint about your db schema, do you want a user ID to be one to one with each book plot? also, why is your primary key a string field? On Saturday, February 5, 2022 at 10:43:05 AM UTC-5 armaan...@gmail.com wrote: > Hello everyone, > > when i am trying to add uuid primary key , I am

Re: Potential bug: mysql-connector-python Django 3.2.11 and third-party packages that populate the Admin Site

2022-02-03 Thread Jason
can you observe the same behavior in previous versions of connector? You listed two patch versions, makes me curious where in the 8.x version line this works. Likely this is an issue with mysql-connector-python, but with it being an Oracle product, it doesn't have much internal visibility.

Re: intermittent migration error

2022-01-26 Thread Jason
nice find! I would open a django issue, repeating what you have here, so Mariusz can see and triage. On Tuesday, January 25, 2022 at 2:10:18 PM UTC-5 Ben wrote: > Hello, > > I ran into an intermittent migration issue on Django 4.x and PostgreSQL. > The migrations work fine on Django 3.2.x,

Re: Reversing URLs across services

2022-01-22 Thread Jason
yes, this is answered at https://stackoverflow.com/a/32171651 On Saturday, January 22, 2022 at 8:07:09 AM UTC-5 Noemi Millman wrote: > Hi folks -- > > Let's say you have two different services with different views and > URLConfs; some shared modules/apps and some service-specific. Is there a

Re: request.POST.getlist('xxx') only has one value in ajax request for many2many

2022-01-16 Thread Jason
https://code.djangoproject.com/ticket/1130 Essentially, this is expected behavior, and previous comment is correct. Need to loop through the items in the list On Sunday, January 16, 2022 at 5:42:45 PM UTC-5 richy...@gmail.com wrote: > You might want to loop through the list > Example: >

Re: dotenv - django-environ - etc

2021-12-28 Thread Jason
an env file is basically imported into your OS environment, so you can retrieve them with the same interface. That means you can easily include that with your build environment, or inject in some other means. Can't do that with settings. Also, lets you keep one settings file, and use

Re: are migrations the same regardless of database type?

2021-12-28 Thread Jason
Not exactly. Migrations try to be generalized across db types, but that doesn't mean that you can be using db-specific features in your models and ORM usage. Thats one reason its highly, highly recommended to use the same database and version at all layers of your stack. In other words, if

Re: Why does sqlmigrate need a connection to an existing database?

2021-12-11 Thread Jason
ath for `if self.connection is > None:`, so that shouldn't be an issue? > As far as atomicity, what if, in a case where no connection is found, it > could just prompt: "No database connection found. Do you want your > migration to be atomic? (y/N)" > On Thursday, 9 December 2021 a

Re: How to import UGETTEXT_LAZY ON DJANGO 4.0

2021-12-10 Thread Jason
https://docs.djangoproject.com/en/4.0/releases/3.0/#id3 On Friday, December 10, 2021 at 12:01:03 AM UTC-5 ngal...@gmail.com wrote: > Thanks hopefully the same to ugettext > > > > Kind Regards > > > > Ngallen Ramadhan > > T: +255 765 889 960 <+255%20765%20889%20960> | Emial: ngal...@gmail.com

Re: AttributeError: 'Values' object has no attribute 'link_base' in building sphinx documentation.

2021-12-09 Thread Jason
you could raise a bug report on the django tracker at https://code.djangoproject.com/query but I'm doubtful that this will gain any traction Those versions of django you specified are very out of date. 1.10 was EOL in 2017, 1.11 EOL'd April 2020 and 2.0 EOLd Aug 2018 If you don't have any

Re: Why does sqlmigrate need a connection to an existing database?

2021-12-09 Thread Jason
It uses db connection in two places: building the migration graph in order to load previous applied migrations and transaction begin/end wrapping

Re: Why does django throw TypeError when sending requests through Apache WSGI?

2021-12-09 Thread Jason
with your settings usage, are you defining a property in settings and trying to use it anywhere? furthermore, are you using settings via from traveldata.traveldata import settings (example) or via from django.conf import settings The latter is the recommended means because settings are

Re: Setting debug=false is no workig

2021-11-07 Thread Jason
eep, that's a really old version. what I'd do is • grep your project to make sure you're not defining DEBUG anywhere else • ensure you restarted your server (apache, nginx, etc) process • ensure your code you're looking at is the same as what is deployed. On Sunday, November 7, 2021 at 4:44:57

Re: How to update old data with new data everyday from a scraper

2021-09-18 Thread Jason Turner
Take a look at update_or_create() https://docs.djangoproject.com/en/3.2/ref/models/querysets/#update-or-create On Sat, Sep 18, 2021, 9:27 AM Adib Neymar Jr. wrote: > Hello, > > What is a good way to compare new data with old data which is updated > everyday with Django ORM? Basically I have a

Re: Surpress Daphne request logging levels

2021-08-23 Thread Jason
daphene runs at the same infra layer level as uwsgi/gunicorn so you need to define the log level at process init. Django has no control over this. On Friday, August 20, 2021 at 12:05:17 PM UTC-4 benny.s...@gmail.com wrote: > I am trying to surpress the log output from daphne. > > example log:

Re: Strange Errors when Using MySQL DB

2021-08-21 Thread Jason
https://code.djangoproject.com/ticket/13906 might give some backgroud on this. tl;dr its django setting the default transaction the errors your seeing are mysql bugs, would it be possible to update to a newer version or at least the latest patch of 5.7? On Friday, August 20, 2021 at 12:05:20

Re: 2.2.* to 3.2.5 update: jsonb deserialisation is broken!

2021-08-01 Thread Jason
going from 2.2.x to 3.2 is three separate releases of django. That's alot to go in one jump. Might help if you update one release at a time and narrow down which version this regression is in. In addition, I'd check the changelogs for each version and see what, if any, might apply to your

Re: Admin TypeError - Cannot call delete() after .distinct()

2021-07-02 Thread Jason
https://code.djangoproject.com/ticket/32682 might be the root cause, which was fixed end of April and part of the 3.2.1 release, doesn't seem like its been backported to 3.1 On Friday, July 2, 2021 at 2:03:28 AM UTC-4 Mike Dewhirst wrote: > Trying to delete a record in the Admin list view by

Re: how to prevent Django do auto capitalize static text in templates

2021-05-18 Thread Jason Turner
Have you tried Bootstrap's class="text-lowercase"? On Tue, May 18, 2021, 8:23 AM Samuel Nogueira wrote: > I am using bootstrap, so my CSS shouldn't go wrong > > > Em ter., 18 de mai. de 2021 às 10:04, 712189512 < > gabrielstonede...@gmail.com> escreveu: > >> It’s not django that’s doing

Re: django3.2---bug win10

2021-04-25 Thread Jason
that's not a bug. Look at the two inputs in your terminal. First one starts with a `>`, looks like you copied it verbatim. `>>>` is convention for terminal prompt On Sunday, April 25, 2021 at 10:37:59 AM UTC-4 cqwuxi...@gmail.com wrote: > > [image: QQ截图20210425220126.png][image:

Re: Try to make startapps but getting error

2021-04-15 Thread Jason Turner
Name the app something other than hello_world. It appears as if there is a conflict. On Thu, Apr 15, 2021, 8:23 AM Binay kumar wrote: > CommandError: 'hello_world' conflicts with the name of an existing Python > module and cannot be used as an app name. Plea se try another name. > > please help

Re: Align Two buttons in a TD

2020-10-24 Thread Jason R
I'd wrap your td element in a container and display it as a flex element. That will probably conflict with bootstrap though. On Sat, Oct 24, 2020 at 7:27 PM Walter Randazzo wrote: > Sorry, I forgot to attach the file. This is how the template looks like > now: > > El sábado, 24 de octubre de

Re: Django 3.1.2 JSONField handling error with an Postgres Foreign Data Wrapper-based model

2020-10-18 Thread Jason
looks like you got a response back, and there's more context in the linked ticket too. tl;dr json is not jsonb, and django only works with the latter On Thursday, October 15, 2020 at 10:02:30 AM UTC-4 shahee...@gmail.com wrote: > Thanks Jason, I filed https://code.djangoproject.com/tic

Re: Django 3.1.2 JSONField handling error with an Postgres Foreign Data Wrapper-based model

2020-10-15 Thread Jason
this is pretty interesting, and may be something to report to the devs at https://groups.google.com/g/django-developers, or open up a ticket at https://code.djangoproject.com/ I don't see any tickets with the query *jsonfield foreign data* that are similar with your experience, so you may

Re: how to make docker image of your django app

2020-06-17 Thread Jason Turner
https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/ Also, Will Vincent's book "Django for Professionals" is a good resource. On Wed, Jun 17, 2020, 8:51 AM Anirudh choudhary < anirudhchoudary...@gmail.com> wrote: > I Want to make make a docker image of my Django app

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-26 Thread Jason Turner
Is the csv something you created? Or was it given to you? I use pandas extensively & the times I've received that error, the issue has been with the file itself. Ard there blank line(s) at the top of the file? On Tue, May 26, 2020, 4:11 AM jakote lejaha wrote: > The same very same file works

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-25 Thread Jason Turner
Are you sure the file is coma delimited? This error is usually because the file is not coma separated. On Mon, May 25, 2020, 5:04 PM jakote lejaha wrote: > Ideally I would have wanted to use the "csv.reader" function, but in this > case it becomes complicated as I would like to load the cvs

Re: Dynamic Radio Form

2020-05-05 Thread Jason Turner
Thanks. That makes sense. Appreciate your help. On Tue, May 5, 2020, 11:11 AM Chetan Ganji wrote: > To answer your question, you could add an extra field on schedule model to > store the winner > e.g. winner = models.CharField(max_length=55) > > IMO, league and team in the schedule model should

Re: Django form fields order

2020-04-10 Thread Jason
python dicts are ordered in terms of insertion order as an implementation detail in cpython 3.6, and was made part of the spec in 3.7. You might be getting bit by this. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: selectfilter2 javascript and django

2020-03-26 Thread Jason Liu
Thank you so much for providing the solution, it solved my problem as well. On Wednesday, April 29, 2015 at 6:34:25 AM UTC-7, Dimitris Kougioumtzis wrote: > > > ok i found it > > in the urls.py i add the > > (r'^jsi18n/$', 'django.views.i18n.javascript_catalog'), > > > and in template > >

Re: Serializing forms and formsets to pass to Celery task

2020-02-29 Thread Jason
As said before, you really can't do that too well with celery. Its a good practice to keep the message body between django -> broker -> worker to be as small as possible because we don't know what your configuration for the broker is. In addition, you should never, ever, put sensitive

Re: Adding a verbose_name to id field

2020-02-10 Thread Jason
Hmm. TIL about https://code.djangoproject.com/ticket/8576 Would a a uuid for this, rather than an integer? If not, you'll have to implement a save override to handle the incrementing yourself. In addition, it might be worthwhile bringing this ticket up for discussion at

Re: Adding a verbose_name to id field

2020-02-09 Thread Jason
You just need to use AutoField -- 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: Adding a verbose_name to id field

2020-02-08 Thread Jason
Sounds to me you'd like a separate auto-increment field? On Saturday, February 8, 2020 at 11:55:48 AM UTC-5, Bruckner de Villiers wrote: > > Mike, > > I tried id = model.AutoField(verbose_name=”Ticket #”). Migrate didn’t > like it – can’t have duplicate primaries. I suspect this is because

Re: is there a WYSIWYG for Django

2020-02-08 Thread Jason
Anytime you have a question of "is there something in django that will do X?", check out https://djangopackages.org/ For example, there is a pretty good up to date WYSIWYG category with possible options https://djangopackages.org/grids/g/wysiwyg/ -- You received this message because you are

Re: Python Django Training

2020-02-02 Thread Charles Jason Decena
i am also interested Charles Jason Decena Developer 33F UnionBank Plaza Bldg., Meralco Ave. Ortigas Center, Pasig City www.ubx.ph [image: linkedin] <https://www.linkedin.com/company/ubx-philippines/> [image: facebook] <https://www.facebook.com/ubxphilippines/> [image: twi

Re: Jinja pattern doesnt work inside a for loop

2020-01-25 Thread Jason
While you can use Jinja templates in django, that requires additional configuration to ensure the proper template renderer is used. Otherwise, by default, django uses its own template renderer. You don't say whether you've taken the necessary steps to have your django project use Jinja, and

Re: Django and MySQL NDB Cluster

2020-01-22 Thread Jason
https://code.djangoproject.com/ticket/27677 Check the last comment from Tim. -- 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: URL pattern for URL with query string

2020-01-13 Thread Jason
The url resolver does not include GET query params in a URL, you need to add them manually after the string. for example url = f"{reverse('weather')}/?current_location={some_value}_location={another_value}" -- You received this message because you are subscribed to the Google Groups

Re: How to filter a Window query?

2020-01-01 Thread Jason
I would use raw sql for this, since there's no direct support in the ORM for this. -- 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: Trouble with Django Generic List view

2020-01-01 Thread Jason
when you do return jobs, print(jobs) you're returning a tuple from the method, which is not what is expected. Remove the print statement from that line On Wednesday, January 1, 2020 at 5:02:13 PM UTC-5, Sam Hefer wrote: > > Hi, > > I'm having some issues with displaying a filtered list in

Re: pip install mysqlclient not working

2020-01-01 Thread Jason
OP is on windows, and doesn't have Visual Studio Build Tools installed. That's the problem. https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017 its the last item in the second section. Also, OP, if you have python 2 and 3 on your machine, specify the version of

Re: How to ensure genuine emails despite valid email format?

2019-12-30 Thread Jason
I have no idea if this is a thing in Mailgun, sorry. You'll have to check their documentation. -- 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: How to ensure genuine emails despite valid email format?

2019-12-30 Thread Jason
Part of your problem is that email is a fire-and-forget application. Once it's sent out, its in the control of the email server for routing. 1. I don't know of a way to handle this without having any access to the account the user uses to send the email 2. Use a whitelist of valid

Re: Strange issue with django

2019-12-26 Thread Jason
Also, you haven't stated where the bottlenecks are happening. Is it app code, internal in django, your stack, database, networking? There's alot of variables in play for diagnosing a major slowdown, and you've provided no information about profiling/monitoring -- You received this message

Re: Strange issue with django

2019-12-26 Thread Jason
Do you have any performance monitoring in place, with profiling add-ons, like new relic's x-ray trace? That was really helpful in figuring out a bottleneck in a django service last year. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Handler 500

2019-12-03 Thread Charles Jason Decena
is there a way to retrieve the handler 500 data/error? and also can i have multiple handler 500 in my base url in order to be dynamic? and how to get the error message in handler500 -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: beginner's question

2019-11-05 Thread Charles Jason Decena
Hi, what you have entered is a command on checking on what django version is installed on your machine, i suggest you create pipenv or venv everytime you create projects in order to eliminate other dependencies not required for your project Regards, Charles Jason Decena Developer 33F UnionBank

Re: ModuleNotFoundError: No module named 'mysite.polls'

2019-10-28 Thread Charles Jason Decena
mysite.apps.polls would solve your problem On Sunday, October 27, 2019 at 1:01:09 AM UTC+8, Beto Joaquim wrote: > > hello guys I'm new on Django and I would like to ask your help, I've added > "mysite.polls'' to my SETTINGS > Installed app... but it still say " > ModuleNotFoundError: No module

Re: to make a wish list .

2019-10-28 Thread Charles Jason Decena
Try putting foreign key to the wishlist model On Friday, October 25, 2019 at 7:56:42 PM UTC+8, Shubham Mishra wrote: > > hello, > I am Surendra Mishra , I am student currently i'm learning django. > I applied for internship , but they gave me a task if i complete then they > will consider me .

Re: Celery with SQS

2019-10-27 Thread Jason
g fine with Rabbit as your broker, why the move to SQS while keeping all other dependencies the same? On Saturday, October 26, 2019 at 4:33:23 PM UTC-4, Rogério Carrasqueira wrote: > > Hello Jason! > > Thanks for your reply, it is not so easy to move from 1.4.22 to 2.2, > it a bi

Re: Celery with SQS

2019-10-26 Thread Jason
both those versions are severely out of date, so I would first suggest to update. current version of celery is 4.3, and django is 2.2. If you have reasons to move from rabbit to SQS, why not update everything else while you're at it? -- You received this message because you are subscribed

  1   2   3   4   5   6   7   8   9   >