Re: send_mail not filling mail.outbox in certain circumstance

2020-07-08 Thread Matthew Pava
:55:21 AM UTC-5, Matthew Pava wrote: > > Good day, > I'm writing a functional test for checking that an email was sent after a > record was revised in my project. I placed a print statement to verify that > the send_mail function was called within the view that it is called in, a

send_mail not filling mail.outbox in certain circumstance

2020-07-08 Thread Matthew Pava
Good day, I'm writing a functional test for checking that an email was sent after a record was revised in my project. I placed a print statement to verify that the send_mail function was called within the view that it is called in, and it prints it out at the appropriate time. However, when I

Exception During Testing on Windows, Python 3.8

2020-06-11 Thread Matthew Pava
I continue to receive the following exception error at every single one of my tests. I'm running Python 3.8.2 on Windows 10. Exception happened during processing of request from ('127.0.0.1', 54962) Traceback (most recent call last): File "c:\program

Changing name of file in FileField field

2020-06-09 Thread Matthew Pava
Good day, I have been struggling with this issue for weeks, and I can't figure out what I'm doing wrong. I have a model with a FileField with a custom upload_to function. It seems to work fine when I'm doing runserver. Problems arise during my tests. My assertion error fails: AssertionError:

RE: Legacy DB: ID is null when .save or .create

2019-05-17 Thread Matthew Pava
You may need to reset your auto increment counter in PostgreSQL. I remember having this problem once. https://stackoverflow.com/questions/5342440/reset-auto-increment-counter-in-postgres From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Mei B Sent: Friday,

RE: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread Matthew Pava
Well, I had always assumed that they do need to be integers, but it looks like this has been discussed at length. https://groups.google.com/forum/#!topic/django-users/0utRzn98Wxo It does seem clear, though, that the superior database design uses integers for ForeignKeys. And I didn’t find a way

RE: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread Matthew Pava
That design could definitely be improved, and it will have to be in order to use the ORM effectively. Then you’d have to change every reference to the fields in all the raw querysets in the app. You need a ForeignKey relationship between the two models, which is an integer value, not a char.

RE: Simplifying code with multiple loops and logic, into queryset aggregates

2019-04-30 Thread Matthew Pava
It was a little difficult to follow your message because the formatting is non-standard, but I think this might be what you’re looking for. Also, you should try to follow more Python coding conventions: models start with an upper case letter. Variables start with a lower case letter. And you

RE: left join without where condition

2019-04-26 Thread Matthew Pava
keenly I need reverse of what you told. I. e. Photo modal has Product as ForeignKey class Photo: file=models.FileField() product=models.ForeignKey() On 26 Apr 2019 19:16, "Matthew Pava" mailto:matthew.p...@iss.com>> wrote: Use select_related or just reference it

RE: How to Update Database

2019-04-26 Thread Matthew Pava
You would use the data from request.POST or request.GET. Here’s everything you need to know about views: https://docs.djangoproject.com/en/2.2/topics/http/views/ Here’s an example: def my_view(request): if request.POST: field1 =

RE: left join without where condition

2019-04-26 Thread Matthew Pava
Use select_related or just reference it in the template as an attribute. https://docs.djangoproject.com/en/2.1/ref/models/querysets/#select-related Product.objects.select_related(‘photo’) {% if product.photo %} … {% endif %} From: django-users@googlegroups.com

RE: Integrating Google calendar API in TODO list

2019-04-24 Thread Matthew Pava
Dr. Joel, I think Sipum doesn’t even know how to begin. So Sipum, take a look at this document: https://developers.google.com/calendar/quickstart/python From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Joel Mathew Sent: Wednesday, April 24, 2019 2:07 PM

RE: Is it possible to value based on another aggregation?

2019-04-23 Thread Matthew Pava
Use annotate. https://docs.djangoproject.com/en/2.2/topics/db/aggregation/#generating-aggregates-for-each-item-in-a-queryset From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Kenny Loveall Sent: Tuesday, April 23, 2019 12:58 PM To:

RE: Convertingg rendered Model Data in HTML to PDF USING XHTML2PDF

2019-04-18 Thread Matthew Pava
We use Google’s Puppeteer in Node.js. I use the URL of the HTML page to convert as a GET parameter to the PDF generator view. The PDF generator view then uses subprocess.Popen to run the Node.js script that prints that HTML as a PDF page. As icing on the cake, the user can also automatically

RE: Unhashable TypeError when deleted from model, Django 2.2

2019-04-17 Thread Matthew Pava
Okay, the model I’m using specifies an __eq__ function without a corresponding __hash__ function. I’ve opened a pull request with the owner of that project. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Matthew Pava Sent: Wednesday, April 17, 2019 11:18

RE: Unhashable TypeError when deleted from model, Django 2.2

2019-04-17 Thread Matthew Pava
that would be cheaper and cleaner, especially with lookups. Kind regards, Sithu Sent with Shift<https://tryshift.com/?utm_source=SentWithShift_campaign=Sent%20with%20Shift%20Signature_medium=Email%20Signature_content=General%20Email%20Group> On Tue, Apr 16, 2019 at 9:29 PM Matthe

Unhashable TypeError when deleted from model, Django 2.2

2019-04-16 Thread Matthew Pava
I have a model that has a nullable field called expires. If expires is null, then the record never expires. I'm performing a delete on the model for any record that has an expires date that has passed, and I keep getting a TypeError that Model is unhashable. Am I doing something wrong?

RE: How to properly use MySQL Generated Fields in Django

2019-04-15 Thread Matthew Pava
I wouldn’t save alpha in the database. I would use a property on the model or annotate the field to the object manager. Property: class Guest(models.Model): @property def alpha(self): return self.lname[0] if self.lname else '' Or on

RE: Using forms to handle request.GET data?

2019-04-04 Thread Matthew Pava
Of Carsten Fuchs Sent: Thursday, April 4, 2019 9:51 AM To: django-users@googlegroups.com Subject: Re: Using forms to handle request.GET data? Am 04.04.19 um 16:23 schrieb Matthew Pava: > If you need a default year in your template context, put it there. > > def get_context_data(self

RE: Using forms to handle request.GET data?

2019-04-04 Thread Matthew Pava
And, since you really don't want constants littering your code, you probably want something like this: context['default_year'] = timezone.now().year -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Carsten Fuchs Sent: Thursday,

RE: Using forms to handle request.GET data?

2019-04-04 Thread Matthew Pava
If you need a default year in your template context, put it there. def get_context_data(self, request, *args, **kwargs): context = super().get_context_data(request, *args, **kwargs) context['default_year'] = 2019 return context In your template, you could use this type of construct:

RE: Login by phone number best practice

2019-04-03 Thread Matthew Pava
Check out these: https://djangopackages.org/grids/g/authentication/ A package for phone number authentication: https://github.com/wejhink/django-phone-login -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Mohammad Etemaddar

RE: BaseModelFormSet > _construct_form

2019-04-03 Thread Matthew Pava
019 23:15:15 UTC+2, Matthew Pava wrote: Why are overwriting add_prefix? Why are you overwriting _construct_form? From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf Of nikolaysm Sent: Tuesday, April 2, 2019 9:37 AM To: Django users Subject: BaseModelFormSet > _construc

RE: BaseModelFormSet > _construct_form

2019-04-02 Thread Matthew Pava
Why are overwriting add_prefix? Why are you overwriting _construct_form? From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of nikolaysm Sent: Tuesday, April 2, 2019 9:37 AM To: Django users Subject: BaseModelFormSet > _construct_form Hello, In function

Thank you for the HINT

2019-03-15 Thread Matthew Pava
I am working on some migration code, and I did not enter the _id suffix to my field name in the RunSQL code. Django was very kind to give me the clue to reference the column with the _id suffix. That is an amazing hint, and it helped significantly. Thank you so much! -- You received this

RE: Bug in Django 2.1 on ModelMultipleChoiceField

2019-03-14 Thread Matthew Pava
actly as you did: remove the empty_label keyword argument from the super call. From: Odile Lambert [mailto:pisc...@laposte.net] Sent: Thursday, March 14, 2019 2:10 AM To: django-users@googlegroups.com; Matthew Pava Subject: Re: Bug in Django 2.1 on ModelMultipleChoiceField Hello If this is by d

RE: Bug in Django 2.1 on ModelMultipleChoiceField

2019-03-13 Thread Matthew Pava
Looking at it, I would say that this is by design. You shouldn’t use an empty label on a multiple choice field. Perhaps this should be clarified in the docs. Saying that, if you really want an empty label on a multiple choice field, you could create your own class that initializes empty_label

RE: Django credit card redaction app - - MultiValueDictKeyError

2019-03-07 Thread Matthew Pava
Please just paste the error in the email message. The error message that you have mentions a ‘method’ object, which is not present in the code that you have sent to us. That would be where the problem is. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf

RE: Is there any inline editing the data and delete data in table in Django?

2019-03-04 Thread Matthew Pava
See https://datatables.net. They have a nice editor that you do have to pay for. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Derek Sent: Monday, March 4, 2019 1:10 AM To: Django users Subject: Re: Is there any inline editing the data and delete data in

RE: How to create model for this json data

2019-02-19 Thread Matthew Pava
You can use ForeignKey. Or ArrayField if you're using PostgreSQL as your backend. https://docs.djangoproject.com/en/2.1/ref/contrib/postgres/fields/#arrayfield -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of

RE: Re: Composite Primary / Foreign Key support

2019-02-18 Thread Matthew Pava
"As your requirement is read-only if the data is static you could to create a second database, with all the PK of the legacy database, and then as single Pk field to that table, and access everything through a view of a join the two tables." I had such a requirement, and I created a View in

RE: Password Policy Adherence. Cannot use the passwords used before

2019-02-08 Thread Matthew Pava
I completely support this NIST policy, James. Unfortunately, the PCI Security Standards Council does not support this policy at this time. In order for a company to be PCI compliant, users must change their passwords every three months. PCI compliance is essential for companies to adhere to

RE: how to let django return response to web browser at my own function

2019-02-06 Thread Matthew Pava
You probably just want to use the login_required decorator. https://docs.djangoproject.com/en/2.1/topics/auth/default/#the-login-required-decorator -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of ??? Sent: Wednesday, February 6,

RE: Admin form_url breakout problem

2019-02-04 Thread Matthew Pava
returning the billing payment_view. As soon >>> as I removed that 'return' and let the change_view return the super >>> call it started working. >>> >>> Thank you very much for persisting with me. >>> >>> The Admin is fabulous! Nobel pr

RE: Get very last object of database

2019-01-30 Thread Matthew Pava
You can try Mydb.objects.last() You can also try reversing the order and using first: Mydb.objects.order_by(‘-pk’).first() And for some terminology clarification, a database consists of tables. In Django, a model maps to a table, not a database. A table has fields; a database has tables but

RE: Admin form_url breakout problem

2019-01-28 Thread Matthew Pava
. Regarding your comment on using reverse to derive the link, I agree. I was just being somewhat paranoid and skipping the reverse code which I haven't taken the time to study. I will. Thanks again Mike On 26/01/2019 1:59 am, Matthew Pava wrote: > > Based on the error message, it looks like

RE: Admin form_url breakout problem

2019-01-25 Thread Matthew Pava
] On Behalf Of Mike Dewhirst Sent: Friday, January 25, 2019 3:35 AM To: django-users@googlegroups.com Subject: Re: Admin form_url breakout problem On 25/01/2019 2:40 am, Matthew Pava wrote: Hi Mike, I'm not really seeing why this is throwing errors at you. It seems like you've done everything right

RE: Admin form_url breakout problem

2019-01-24 Thread Matthew Pava
@googlegroups.com] On Behalf Of Mike Dewhirst Sent: Wednesday, January 23, 2019 5:23 PM To: django-users@googlegroups.com Subject: Re: Admin form_url breakout problem On 24/01/2019 9:35 am, Matthew Pava wrote: > Have you tried setting APPEND_SLASH = False in your settings? Yes. The result is ... P

RE: Admin form_url breakout problem

2019-01-23 Thread Matthew Pava
breakout problem On 24/01/2019 1:08 am, Matthew Pava wrote: > > It looks like your second URL is different than the first. > > */admin/substance/substance/1442/change/payment* > > */admin/substance/substance/1442/change/payment/change/* > > If you just want to add a slash,

RE: Django Databade

2019-01-23 Thread Matthew Pava
has mysql? please help me id be very appreciative. On Tuesday, January 22, 2019 at 12:02:58 PM UTC-6, Matthew Pava wrote: You can install PostgreSQL on your home system, if I understand your concern correctly. From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf

RE: Admin form_url breakout problem

2019-01-23 Thread Matthew Pava
It looks like your second URL is different than the first. /admin/substance/substance/1442/change/payment /admin/substance/substance/1442/change/payment/change/ If you just want to add a slash, then add it. /admin/substance/substance/1442/change/payment/ I’m guessing that Django is interpreting

RE: Django Databade

2019-01-22 Thread Matthew Pava
My thing is I'm trying to get it to my server I have vps most tutorials I see are in the view of someone running it on thier home system. On Tue, Jan 22, 2019, 9:08 AM Matthew Pava mailto:matthew.p...@iss.com> wrote: PostgreSQL is my preference. Stick with the built-in backends: ht

RE: Django Databade

2019-01-22 Thread Matthew Pava
PostgreSQL is my preference. Stick with the built-in backends: https://docs.djangoproject.com/en/2.1/ref/settings/#engine -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of officialjoemay...@gmail.com Sent: Tuesday, January 22,

RE: Is Microsoft Visual Studion 2017 Environment is good for Django development ?

2019-01-21 Thread Matthew Pava
I use PyCharm. https://www.jetbrains.com/pycharm/ From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Django Geek Aditya Sent: Sunday, January 20, 2019 1:55 AM To: Django users Subject: Is Microsoft Visual Studion 2017 Environment is good for Django

RE: problem in activating virtual environment in Django with ". \Scripts\activate" command

2019-01-18 Thread Matthew Pava
I would switch over to pipenv and leave the details to that. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of officialjoemay...@gmail.com Sent: Friday, January 18, 2019 8:04 AM To: Django users Subject: Re: problem in activating virtual environment in

RE: Overriding Save in Model

2019-01-16 Thread Matthew Pava
the problem is I cannot save the individual parts and only end up saving the domain name On Wednesday, 16 January 2019 16:55:42 UTC, Matthew Pava wrote: Check out urllib.parse. https://docs.python.org/3/library/urllib.parse.html From: django...@googlegroups.com [mailto:django...@googlegroups.com

RE: Overriding Save in Model

2019-01-16 Thread Matthew Pava
Check out urllib.parse. https://docs.python.org/3/library/urllib.parse.html From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of caleor...@gmail.com Sent: Wednesday, January 16, 2019 10:41 AM To: Django users Subject: Overriding Save in Model I'm trying to

RE: function get_form_kwargs() not being called

2018-12-12 Thread Matthew Pava
Fascinating. It looks normal, though login_url is not a member of CreateView. Do you perhaps have another class defined with the same name? Especially since you do have other class-based views, you must know what you’re doing. From: django-users@googlegroups.com

RE: Cannot get this ModelForm view to save to the db, what am I doing wrong please

2018-12-10 Thread Matthew Pava
It’s hard to tell with some of the spacing in your email. Python cares deeply about spacing. When initializing a form, I typically do it as so: form = RegisterForm(request.POST or None) Also, the save method on the model has several arguments that you are not passing around. def

RE: Poor Performance for Form Rendering In Django 1.11

2018-12-10 Thread Matthew Pava
I vaguely remember having this issue when I moved to Django 1.11. It was frustrating. I have thus far refused to move over to Jinja, and I just use autocompletes for my large select widgets. There is also the possibility of using template fragment caching. Wrap the select in a cache block,

RE: django-EmailSending with PHP

2018-12-06 Thread Matthew Pava
Here, take a look at this: https://www.webforefront.com/django/setupdjangoemail.html From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Andréas Kühne Sent: Thursday, December 6, 2018 2:25 PM To: django-users@googlegroups.com Subject: Re: django-EmailSending

RE: Use an aggregation function's filter with aggregate of a value from an annotation with a subquery

2018-12-05 Thread Matthew Pava
Though I can’t address the issue of whether it is a bug, there is a note in the documentation: https://docs.djangoproject.com/en/2.1/topics/db/aggregation/#filtering-on-annotations “Avoid using the filter argument…” You may want to consider conditional expressions (Case … When) to achieve your

RE: Best way to structure this Django project

2018-12-03 Thread Matthew Pava
I don't think there's a way around it, but that's okay. I have dependencies between several apps in my project, and the apps help organize the project. If you don't want to necessarily hard-code the app model, you could pass in the model as an argument and use apps.get_model(app_name,

RE: Microsoft deprecation for the Python extensions

2018-11-30 Thread Matthew Pava
I could never get Django working with IIS myself, so I simply installed Apache on Windows. I haven’t had much of a problem since. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of El_Merendero Sent: Friday, November 30, 2018 3:56 AM To: Django users

RE: Unexpected behavior on delete of model

2018-11-27 Thread Matthew Pava
You’ll want to review this reference: https://docs.djangoproject.com/en/2.1/ref/models/fields/#django.db.models.ForeignKey.on_delete You probably want the option on doc to be SET_NULL. Actually, I suggest some overall cleanup. Your model names should follow a standard convention. Django

RE: get_or_delete leading to duplicate creation

2018-11-27 Thread Matthew Pava
Avoid using the created_at time in your get_or_create call. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Ankit Khandewal Sent: Tuesday, November 27, 2018 2:01 AM To: Django users Subject: get_or_delete leading to duplicate creation Hello, I am using

RE: Human Readable Values

2018-11-27 Thread Matthew Pava
Override the __str__ method. https://docs.djangoproject.com/en/2.1/ref/models/instances/#str From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Mike Sacauskis Sent: Monday, November 26, 2018 5:36 PM To: Django users Subject: Human Readable Values

RE: UpdateView: input always rejected

2018-11-20 Thread Matthew Pava
You are not referencing the form in the template that is generated by the UpdateView. Check out https://ccbv.co.uk/projects/Django/2.0/django.views.generic.edit/UpdateView/. If you want to have two forms in a view, that’s fine, but you’ll need to manually add the second form in the

Error Email Template

2018-11-19 Thread Matthew Pava
Hi Django users, I would like to change the color scheme of the error trace back in Django, even if it's emailed to me. Is there an easy way to do this? Thank you! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

RE: Fascinating Problem

2018-11-19 Thread Matthew Pava
oups.com] On Behalf Of Matthew Pava Sent: Monday, November 19, 2018 1:04 PM To: django-users@googlegroups.com Subject: RE: Fascinating Problem Okay, I’ve managed to deduce that I’m able to get an email when Debug is True. When Debug is False, I do not get the email. From: django-users@googlegroup

RE: Fascinating Problem

2018-11-19 Thread Matthew Pava
@googlegroups.com Subject: Re: Fascinating Problem Posting the view code might be helpful for folks to help you debug. On November 16, 2018 2:52:12 PM CST, Matthew Pava wrote: I have come across an interesting issue with my error handling. Whenever I go to a URL that throws an exception (I have one

Fascinating Problem

2018-11-16 Thread Matthew Pava
I have come across an interesting issue with my error handling. Whenever I go to a URL that throws an exception (I have one for testing) as one of the ADMINS when DEBUG is False, I get the 500 error, and the email from the server indicating it. When a different user navigates to the URL, the

RE: Migrations - moving model between apps

2018-11-16 Thread Matthew Pava
a RunPython operation to rename them appropriately. Cheers, Simon Le jeudi 15 novembre 2018 18:09:45 UTC-5, Matthew Pava a écrit : I’m moving a model to a different app in my project, and I want to keep the same data that I already have. I created a migration with a RunSQL operation that simply

Migrations - moving model between apps

2018-11-15 Thread Matthew Pava
I'm moving a model to a different app in my project, and I want to keep the same data that I already have. I created a migration with a RunSQL operation that simply renames the table with the new app prefix. However, when I run makemigrations, Django insists on adding a migrations.CreateModel

RE: Sending PDF from javascript to django

2018-11-14 Thread Matthew Pava
There is django-hardcopy. However, I’m in process of changing my PDF generation algorithm. I originally used PhantomJS with gs-print and gs-view for Windows. Unfortunately, PhantomJS has been discontinued, and it wasn’t taking advantage of rendering changes to HTML (especially for printing

RE: Link ID's To Detail Page

2018-11-07 Thread Matthew Pava
, 2018 8:58 AM To: Django users Subject: Re: Link ID's To Detail Page Sorry I typed it in here incorrectly. Thank you for spotting that though :) It is the correct way in my source file. On Wednesday, 7 November 2018 16:55:15 UTC+2, Matthew Pava wrote: If you just copied and pasted from your template

RE: SyntaxError: keyword argument repeated

2018-11-07 Thread Matthew Pava
The error message says “keyword argument repeated” Look at the keyword arguments and check for repeated ones. I see it in the definition of parent. Do you see it? From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Dennis Alabi Sent: Wednesday, November 7,

RE: Link ID's To Detail Page

2018-11-07 Thread Matthew Pava
If you just copied and pasted from your template into this email, the problem is a syntax error. You did not close your URL tag with a %}. {{ incident.ir_num }} {{ incident.eft_lead}} From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Gregory Strydom

RE: Setting up admin in visual studio

2018-11-06 Thread Matthew Pava
PyCharm From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Saeed Pooladzadeh Sent: Tuesday, November 6, 2018 3:31 PM To: Django users Subject: Re: Setting up admin in visual studio There are some tools for visual studio which can make it a python IDE. .I

RE: Turning DEBUG=True causes a tornado of Error 500s

2018-11-02 Thread Matthew Pava
Did you run collectstatic? -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Joel Mathew Sent: Friday, November 2, 2018 2:19 PM To: django-users@googlegroups.com Subject: Turning DEBUG=True causes a tornado of Error 500s When I

RE: Handling Database Tables without a unique column

2018-10-29 Thread Matthew Pava
I certainly do hope that it’s filled with more than just junk. If it truly is just junk, scrap it, and create something else. If you are adding a column named “id”, I don’t think there is a need to set managed to False or really do much of anything else with your model. You could rename the

RE: Identify failed insert field

2018-10-29 Thread Matthew Pava
I usually get this error when I assign an object to a field rather than its pk. So this is probably where your problem is: clinicid=clinicobj.pk -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Joel Mathew Sent: Saturday, October

RE: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread Matthew Pava
get the same deletes. I've narrowed it down that it must be something the users are doing to trigger these deletes, based on logs that would've put them active during a time of a delete. On Wednesday, October 24, 2018 at 10:03:00 AM UTC-5, Matthew Pava wrote: I can’t see anything wrong with what

RE: Django auto-deletes field related to MySQL Transactions

2018-10-24 Thread Matthew Pava
, October 23, 2018 at 11:54:17 AM UTC-5, Matthew Pava wrote: And make sure your form is posting to the save view and not the delete view. Maybe show us your template. From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf Of Joel Sent: Tuesday, October 23, 2018 11:32 AM

RE: Django auto-deletes field related to MySQL Transactions

2018-10-23 Thread Matthew Pava
s user deletion, but no one has claimed to have done so. No other apps are connected. Thanks for the tip!! On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote: It doesn’t seem like Django would be doing this. Do you have any other apps connected to the database? You’ll probabl

RE: Django auto-deletes field related to MySQL Transactions

2018-10-23 Thread Matthew Pava
backend, I'm using the default provided by Django: ['django.contrib.auth.backends.ModelBackend'] Thank you for the help! On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote: Check your source code for any delete commands. This might also be your authentication backend. Which

RE: Django auto-deletes field related to MySQL Transactions

2018-10-23 Thread Matthew Pava
Check your source code for any delete commands. This might also be your authentication backend. Which one are you using? From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of RyanW Sent: Monday, October 22, 2018 7:55 PM To: Django users Subject: Django

RE: There's a complete CRUD app for django, like Admin?

2018-10-23 Thread Matthew Pava
You might want to have a look at YourLabs CRUDLFAP+: https://yourlabs.io/oss/crudlfap From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Fellipe Henrique Sent: Tuesday, October 23, 2018 7:02 AM To: Django Users Subject: There's a complete CRUD app for

RE: Creating seperate unique ids within the same table

2018-10-22 Thread Matthew Pava
nkham Sent: Monday, October 22, 2018 11:51 AM To: django-users@googlegroups.com Subject: Re: Creating seperate unique ids within the same table On Oct 22, 2018, at 12:29, Matthew Pava wrote: > I am curious why you think it is anti-practice to expose primary keys for > user-visible purposes. &g

RE: Creating seperate unique ids within the same table

2018-10-22 Thread Matthew Pava
I am curious why you think it is anti-practice to expose primary keys for user-visible purposes. My URLs all have the PK to the object in them, and any advanced user would be able to “reverse engineer” a URL if they guess the PK of an object—and that’s okay. Even Django tutorials suggest using

RE: How can I implement built in signals, for my app?

2018-10-22 Thread Matthew Pava
You may want to look at this middleware package that will automatically audit user logins. https://github.com/muccg/django-useraudit Also, in using AppConfigs, avoid using default_app_config as stated here: https://docs.djangoproject.com/en/2.1/ref/applications/#configuring-applications "New

RE: Creating seperate unique ids within the same table

2018-10-18 Thread Matthew Pava
8 at 19:01, Matthew Pava wrote: > > Hi Dr Joel, > Each patient already has a unique number--the id or pk of the > model--regardless of what clinic the patient goes to. I even recommend > maintaining this structure. Any other numbers you add to the ID are just > noise. Besides

RE: Creating seperate unique ids within the same table

2018-10-18 Thread Matthew Pava
ient id but many checkin ids. > > What can be a good approach to solve this? Should I perhaps create another > table just to store the last patient id issued to each clinic? > > > > > On Wed, 17 Oct 2018 at 21:49, Matthew Pava wrote: >> >> A number is a nu

RE: Creating seperate unique ids within the same table

2018-10-17 Thread Matthew Pava
A number is a number, and we don’t need to attach meaning to it. Why do you need to have continuous ids unique to each clinic? As a developer, I would object to anyone forcing such a requirement. If they insisted, then I would add a property that is calculated each time based on the count of

RE: Need help for sql stored proc

2018-10-17 Thread Matthew Pava
https://docs.djangoproject.com/en/2.1/topics/db/sql/#calling-stored-procedures From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Gurmeet Kaur Sent: Wednesday, October 17, 2018 11:06 AM To: django-users@googlegroups.com Subject: Need help for sql stored proc

RE: FormModel not validating the fields

2018-10-16 Thread Matthew Pava
It’s difficult to tell with your spacing in the email. The function needs to be inside the class, not outside. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of faizan.fa...@gslab.com Sent: Tuesday, October 16, 2018 4:34 AM To: Django users Subject:

RE: psycopg2 Substr SQL generator bug?

2018-10-09 Thread Matthew Pava
uesday, October 9, 2018 at 9:48:22 AM UTC-7, Matthew Pava wrote: Oh, I see. Then just use Cast, or the output_field argument . Conference.objects.annotate(year=ExtractYear('start_date', output_field=CharField())).filter(website__contains=F('year')) From: django...@googlegroups.com [mailto:django...@go

RE: psycopg2 Substr SQL generator bug?

2018-10-09 Thread Matthew Pava
ment types. You might need to add explicit type casts. On Tuesday, October 9, 2018 at 6:45:32 AM UTC-7, Matthew Pava wrote: I would submit a ticket for that issue. Also, instead of using string functions to solve your problem, I would use the ExtractYear function. Conference.objects.ann

RE: Alternatives to using __contains?

2018-10-09 Thread Matthew Pava
No. Usually, you would try to keep all of your filtering in the managers module, and then you would be able to limit your refactoring of filters in that file. You could try using *args and **kwargs syntax, but that would make it difficult to maintain. I suppose you could functions in SQLAlchemy,

RE: psycopg2 Substr SQL generator bug?

2018-10-09 Thread Matthew Pava
I would submit a ticket for that issue. Also, instead of using string functions to solve your problem, I would use the ExtractYear function. Conference.objects.annotate(year=ExtractYear('start_date')).filter(website__contains=F('year')) From: django-users@googlegroups.com

RE: "No such table" error, with different tablename as in query

2018-10-08 Thread Matthew Pava
It almost seems like your database is corrupt. Did you run migrations before running the server? From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Michel Lavoie Sent: Monday, October 8, 2018 1:15 PM To: django-users@googlegroups.com Subject: Re: "No such

RE: "No such table" error, with different tablename as in query

2018-10-08 Thread Matthew Pava
. But I'm sure that it doesn't come from my views.py, this error appeared after upgrading to 2.1. My app's code is on GitHub: https://github.com/miek770/huitcent/tree/master/finance Thanks, Michel On Mon, Oct 8, 2018, 09:46 Matthew Pava, mailto:matthew.p...@iss.com>>

RE: "No such table" error, with different tablename as in query

2018-10-08 Thread Matthew Pava
Hi Michel, The error states that there is no such table finance_transactions with an s on the end. Maybe you could show us your view code, but that would be the place that I would start at. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Michel Lavoie

RE: db_index=True not creating indexes

2018-10-05 Thread Matthew Pava
Hi, I’m using Django 2.0 and PostgreSQL 9.something, but my tables do have indexes. Did you run the makemigrations command before running the migrate command? Also, you can modify the database that Django uses however you want with some caveats. Anyway, you can add views and modify columns

Running Signal when Related Field is Updated

2018-09-26 Thread Matthew Pava
I have a similar set up to this (simplified): class Transaction(models.Model): sns = models.ManyToManyField(SN, related_name="transactions", blank=True) qty = models.FloatField() part = models.ForeignKey(Part, on_delete=models.CASCADE) class InventoryTransaction(models.Model):

RE: django raw sql query does not return data

2018-09-26 Thread Matthew Pava
Listen to the error message. Include the primary key in the queryset. You can use any field and alias it as “id” if you need to trick the system. Although, couldn’t that raw query use the ORM in a better way? Post.objects.annotate(uno=Count(‘title’), published_date_date=Cast(‘published_date’,

RE: Multiple annotations in one query

2018-09-24 Thread Matthew Pava
Hi David, Performing multiple annotations on a queryset is not the same as combining multiple aggregations. Saying that, if you truly are getting wrong results, you could try using the Window functions or the Subquery object.

Re: Error at OneToOneField in models while creating new models class

2018-09-22 Thread Matthew Pava
Did you try running your migrations? Get Outlook for Android On Sat, Sep 22, 2018 at 5:07 AM -0500, "Srinivas Gadi" mailto:srini@gmail.com>> wrote: Adding more and complete details: I am facing below error while creating a new model class. the error pops up only

RE: Chaining Q objects

2018-09-19 Thread Matthew Pava
I’m not entirely sure if the error is from your Q chain, but something I would try is to replace “[:1].get()” with “.first()”. wm = Boat.objects.filter(name=x).filter( f ).first() From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of MikeKJ Sent: Wednesday,

RE: Kerberos authent implementation

2018-09-13 Thread Matthew Pava
Hi Benjamin, If it’s any help to you, we use LDAP through Active Directory for our authentication system. We use the django-auth-ldap package. It’s been a little tricky with the upgrade to Python 3/Django 2, but it’s quite manageable. Unfortunately, I can’t help you much with Kerberos

  1   2   3   4   >