RE: MultiWidget not rendering

2016-12-19 Thread Matthew Pava
I’m not that familiar with MultiWidget, but it would seem that your print statement should be: print(fourteen.mywidget) From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Farhan Khan Sent: Monday, December 19, 2016 11:40 AM To: Django users Subject: MultiWidg

Model _meta API

2016-12-21 Thread Matthew Pava
Since the standardization of the Model _meta API and making it public, I was wondering if Django plans on removing the underscore in _meta in the future? Just curious. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

RE: Model _meta API

2016-12-21 Thread Matthew Pava
Thank you so much for that clarification! -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send

RE: Url error

2016-12-28 Thread Matthew Pava
It looks like you need to remove “id/” from the URL in the address bar or add “id/” to the beginning of the URL in your urlpatterns. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Sharan Kumar Sent: Wednesday, December 28, 2016 9:29 AM To: Django users Su

RE: What is the best combination of components when installing Django on Windows 10?

2016-12-28 Thread Matthew Pava
For what it’s worth, I use Windows 10 as my development environment. We use Windows Server 2012 in production with PostgreSQL and Apache 2.4 with modwsgi. We use Python 3.5 and Django 1.10. All of our tools are 64-bit. What’s really nice is that we have a method to print webpages directly fr

RE: Just added Python, Django and MySQL integration template for easier data visualization with AnyChart JS

2016-12-29 Thread Matthew Pava
I took a quick glance, and they are advertising Django integration to show an example of how to retrieve the data from the database through Django ORM to be used in the HTML template that is rendered by Django and includes the script tag with the AnyCharts.js file. We are currently using two di

RE: request.read() is empty in POST

2017-01-04 Thread Matthew Pava
I have never used request.read() or tried decoding the request, and I had no idea that request even had an encoding attribute. You stated that you had the exact same code working elsewhere. Is there some difference in the settings file? Some difference in the environment you are using? When

RE: Abridged summary of django-users@googlegroups.com - 25 updates in 12 topics

2017-01-05 Thread Matthew Pava
We don’t typically import urls.py. Why are you importing it, and where are you importing it? From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Erik Mvñoz Sent: Thursday, January 5, 2017 3:03 AM To: django-users@googlegroups.com Subject: Re: Abridged summary

RE: Dynamic Models

2017-01-05 Thread Matthew Pava
Going down that route, we would basically be developing an IDE for Django models. It would definitely be possible, but it would involve a lot of work. Maybe it could even be integrated into django-admin one day. You may want to check out http://www.web2py.com/ which does its own web IDE for P

RE: Dynamic Models

2017-01-05 Thread Matthew Pava
@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Guilherme Leal Sent: Thursday, January 5, 2017 1:06 PM To: django-users@googlegroups.com Subject: Re: Dynamic Models @Matthew Pava >Going down that route, we would basically be developing an IDE for Django >models Well, th

RE: Dynamic Models

2017-01-05 Thread Matthew Pava
That is fascinating. I have been thinking about a way of handling our product categories so that we could have better data validation on certain "fields" within a part category. However, I have been leaning more towards having a comma separated list or PostgreSQL ArrayField to store the multip

RE: Form Inheritance. Order is Reversed.

2017-01-10 Thread Matthew Pava
Hi Justin, Something that caught my eye is {% for d in forms.myforms %}. If you have one form, D, then I don’t think you should need to loop through the other forms. After saying that, it does look like there was a change in field order in Django 1.7. See https://github.com/pennersr/django-all

RE: Trying to print data containing a space in html

2017-01-10 Thread Matthew Pava
You might want to consider just wrapping the text in a tag. {% for x in data %}{{ x }}{% endfor %} From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Asad Jibran Ahmed Sent: Tuesday, January 10, 2017 1:39 AM To: django-users@googlegroups.com Subject: Re: Try

RE: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread Matthew Pava
You import views in your urls.py file. Your settings.py file has a constant pointing to where the urls.py file is located for the project. Your urls.py file is the one that actually utilizes the views file. From: 'Peter Müller' via Django users [mailto:django-users@googlegroups.com] Sent: Mond

RE: RedirectView failing silently on NoReverseMatch is confusing

2017-01-19 Thread Matthew Pava
It looks like Tim wanted you to talk to the Django Developers list. This is the Django Users list. Stating that, I think the NoReverseMatch exception should not be caught. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Grzegorz Tezycki Sent: Thursday, J

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 ext

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.co

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 Django

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 developme

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, 20

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 backend

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 t

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 Of

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: Admin form_url breakout problem

2019-01-24 Thread Matthew Pava
ango-users@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

RE: Admin form_url breakout problem

2019-01-25 Thread Matthew Pava
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 everyt

RE: Admin form_url breakout problem

2019-01-28 Thread Matthew Pava
ithin the Admin. 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 mes

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-02-04 Thread Matthew Pava
t; >>> ... I noticed that I was 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. >>>

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: 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 w

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 Post

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 optvisi...@gmail.com

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: 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 Of

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 how

RE: Bug in Django 2.1 on ModelMultipleChoiceField

2019-03-14 Thread Matthew Pava
he clear solution is to do exactly 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 ModelMultipleChoice

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 messa

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 _constr

RE: BaseModelFormSet > _construct_form

2019-04-03 Thread Matthew Pava
ril 2019 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 > _con

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 Sent

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: 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, Ap

RE: Using forms to handle request.GET data?

2019-04-04 Thread Matthew Pava
glegroups.com] On Behalf 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. > >

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 the

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? Model.ob

RE: Unhashable TypeError when deleted from model, Django 2.2

2019-04-17 Thread Matthew Pava
would be cheaper and cleaner, especially with lookups. Kind regards, Sithu Sent with Shift<https://tryshift.com/?utm_source=SentWithShift&utm_campaign=Sent%20with%20Shift%20Signature&utm_medium=Email%20Signature&utm_content=General%20Email%20Group> On Tue, Apr 16, 2019 at 9:

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: 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 prin

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: django-users@googlegroup

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 To:

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 [mailto:django-users@go

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 = request.POST.get(‘field

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: 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 pro

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. Yo

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: 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: Link to urls containing slug

2017-01-31 Thread Matthew Pava
Assuming I’m understanding your question correctly, all you need to do is reference get_absolute_url in your template. Something like so: {{ job_application }} From: 'dtdave' via Django users [mailto:django-users@googlegroups.com] Sent: Tuesday, January 31, 2017 8:46 AM To: Django users Subject:

RE: Link to urls containing slug

2017-01-31 Thread Matthew Pava
it doesn't work but thanks anyway. On 31/01/2017 14:57, Matthew Pava wrote: Assuming I’m understanding your question correctly, all you need to do is reference get_absolute_url in your template. Something like so: {{ job_application }} From: 'dtdave' via Django users [mailto:djan

RE: Link to urls containing slug

2017-02-01 Thread Matthew Pava
or this form is: url(r'^(?P[-\w]*)/(?P[-\w]*)/job_application/$', views.job_application, name='job_application'), I can go to this link directly in my browser as follows: http://localhost:8000/jobs/1/slug-name/job_application/ What I am looking to achieve is a link within th

RE: Logs bloated by template variable not found in DEBUG level

2017-02-08 Thread Matthew Pava
I would define avar in the context inside the view function with a value of None (or other falsey value). From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Florian Perrodin Sent: Wednesday, February 8, 2017 3:37 AM To: Django users Subject: Logs bloated by t

RE: counting words in word document works in python but not in django

2017-02-15 Thread Matthew Pava
You may want to consider a different package or python function. Here is a way to extract only the text from a docx without using python-docx: http://etienned.github.io/posts/extract-text-from-word-docx-simply/ There is also another script that appears to be more accurate by taking headers and fo

get_or_create IntegrityError

2017-02-16 Thread Matthew Pava
This is a fascinating issue, fellow Django users. I have a model called Lookups that is basically just an auto-generated pk and a name. I added some data to that table using pgAdmin 3 since I'm using a PostgreSQL backend. One of my users then filled out a form that ran some code that would 'ge

RE: Error using url in django template language

2017-02-16 Thread Matthew Pava
In your urls.py, you have the url name as “ytlinks” with an s. But your url tag doesn’t have the s. Try this: {% url ‘ytlinks.ytlinks’ %} From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of xyron Sent: Thursday, February 16, 2017 9:35 AM To: Django users Sub

RE: Question about m2m and forms

2017-02-17 Thread Matthew Pava
Hi Carlos, You probably want to create a new widget and override its label_from_instance method. class BModelMultipleChoiceField(forms.ModelMultipleChoiceField): def label_from_instance(self, obj): return "%s (%s)" % (obj, obj.count_a) And then you'll want to change your

RE: combining ORM and raw SQL in same query

2017-02-21 Thread Matthew Pava
I would use Case and When and other Func objects. https://docs.djangoproject.com/en/1.10/ref/models/conditional-expressions/ That way we don't have to depend on raw SQL. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Larry Martel

RE: Looking for Django tutorial that illustrates master/detail data models

2017-02-22 Thread Matthew Pava
I recommend taking a look at Formsets and, in particular, Inline Formsets. The documentation: ModelForms: https://docs.djangoproject.com/en/1.10/topics/forms/modelforms/ ModelFormsets: https://docs.djangoproject.com/en/1.10/topics/forms/modelforms/#model-formsets InlineFormsets: https://docs.djan

RE: How do you populate an update form in a Bootstrap Modal?

2017-03-03 Thread Matthew Pava
Hi Mike, Make sure you are setting the instance argument when you instantiate the form. Typically, you would pass in a pk to the view. def my_update_view(request, pk): obj = get_object_or_404(MyModel, pk=pk) form = MyForm(request.POST or None, instance=obj) …. I hope this helps you. Best wishes,

RE: How do you populate an update form in a Bootstrap Modal?

2017-03-03 Thread Matthew Pava
I see. We are using Bootbox for our modals, but I’m sure the concept is the same. We have a separate template of the form that we include when we initialize the page. We have an event listener on the modal button, so that when it is clicked, it replaces the HTML inside the form with the HTML

RE: Simple Join with no matching primary keys

2017-03-08 Thread Matthew Pava
Why are there no better design options to implement them? Are the tables being used in another software that you have no control over? I would just merge the two tables and use one model. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of aysha...@gmail.com

Migrations

2017-03-10 Thread Matthew Pava
Does anyone else get a migraine when working migrations? -- 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 django-users+unsubscr...@googlegroups.com. To post to th

RE: Migrations

2017-03-13 Thread Matthew Pava
users@googlegroups.com] On Behalf Of Mike Dewhirst Sent: Saturday, March 11, 2017 1:23 AM To: django-users@googlegroups.com Subject: Re: Migrations On 11/03/2017 7:17 AM, Matthew Pava wrote: > > Does anyone else get a migraine when working migrations? > Only when I try to game the

RE: filter chaining v/s filter with multiple arguments.

2017-04-03 Thread Matthew Pava
Hi Mahendra, You can view the SQL that is generated by using the query attribute on the QuerySet. q = Blog.objects.filter(entry__headline__contains='Lennon', entry__pub_date__year=2008) print(str(q.query)) That should help in understanding what is going on. Best wishes! From: django-users@goo

RE: How to design High Scalability architecture with Django in cost effective fashion

2017-04-03 Thread Matthew Pava
Hi Mihir, Though I am no expert on distributed systems, you may want to check out the possible DATABASES settings. You can specify multiple databases in your settings file. See https://docs.djangoproject.com/en/1.10/topics/db/multi-db/ I would read about Django database routing to get started.

RE: filter chaining v/s filter with multiple arguments.

2017-04-03 Thread Matthew Pava
but both are giving same query. I had tried this even before initiating this mail chain, and this was the point where I got confused. Thanks and regards, Mahendra Gaur On 3 Apr 2017 6:55 p.m., "Matthew Pava" mailto:matthew.p...@iss.com>> wrote: Hi Mahendra, You can view the S

RE: filter chaining v/s filter with multiple arguments.

2017-04-04 Thread Matthew Pava
Well, this is a time I wish I could delete my previous message from existence. After looking at my own code, I realize now that I didn’t use much chaining; rather, I used Q objects and the & operator. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Todor

RE: Setting variable in custom template

2017-04-04 Thread Matthew Pava
You can use the {% with %} tag. https://docs.djangoproject.com/en/1.10/ref/templates/builtins/#with From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of valerio orfano Sent: Tuesday, April 4, 2017 9:15 AM To: Django users Subject: Setting variable in custom tem

ModelForm has no model class specified.

2017-04-04 Thread Matthew Pava
I have a form similar to that declared below: class LineItemForm(Mixin, forms.ModelForm): cost = forms.FloatField() field_order = ['part', 'cost'] class Meta: model = LineItem fields = ['part'] And then I have another form that inherits from that: class InventoryTransactionForm(Line

RE: How to make a dynamic table/form

2017-04-07 Thread Matthew Pava
Datatables has an Editor. https://datatables.net/ There’s also a package that let’s Django and Datatables talk with each other quite well. https://pypi.python.org/pypi/django-datatables-view From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of roset...@gmail.

RE: Strange issue in CSRF

2017-04-09 Thread Matthew Pava
I have had that issue as well. It happens very infrequently for me, and I have yet to find a solution to it. My guess, at least in my situation, is that it has something to do with authentication and resetting the server while a user is filling out the form. Since a simple refresh works in my

RE: Password reset custom view

2017-04-09 Thread Matthew Pava
As another user mentioned, you did not specify the name keyword argument for password_reset_done. You also have the line commented out in your urls file. # url(r'^password_reset/done/$', auth_views.password_reset_done, {'template_name': 'user_management/password_reset_done.html','post_reset_r

RE: Run model check with Django 1.11 as deployment check only?

2017-04-10 Thread Matthew Pava
I would argue that your code should be able to run successfully with an empty database. I would change your assignment of maxID to this: maxID = cls.objects.aggregate(Max('id'))['id__max'] or 0 I often add the 'or 0' to my aggregates because I never really know if my aggregate will deal with an

RE: Run model check with Django 1.11 as deployment check only?

2017-04-10 Thread Matthew Pava
-users@googlegroups.com] On Behalf Of Carsten Fuchs Sent: Monday, April 10, 2017 11:08 AM To: django-users@googlegroups.com Subject: Re: Run model check with Django 1.11 as deployment check only? Hi Matthew, Am 10.04.2017 um 15:51 schrieb Matthew Pava: > I would argue that your code should

RE: Django forks

2017-04-17 Thread Matthew Pava
Something you may want to consider is web2py. It has a lot out of the box. http://www.web2py.com/ -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Jamesie Pic Sent: Monday, April 17, 2017 9:58 AM To: django-users@googlegroups.co

RE: Django forks

2017-04-17 Thread Matthew Pava
Well, since web2py is in Python, you might find some inspiration there for any extensions or improvements to Django that you would like to see. Why reinvent the wheel, you know? -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of J

RE: Django forks

2017-04-17 Thread Matthew Pava
You are the author of DAL? Nice to meet you! We use that! We do use version 2 of it, though. We couldn't find a very important feature for us to upgrade to v3: a text autocomplete that is not based on a pk of a model. Also, unfortunately, with the release of Django 1.11, the autocompletes f

RE: Django forks

2017-04-17 Thread Matthew Pava
Django 1.11 made a major change to widget rendering. I am wondering if this would help you significantly in your quest. The widget is rendered with a template. It would seem you could include the JavaScript in that template. But you are right; it is quite frustrating when I'm going to the ad

RE: Django forks

2017-04-20 Thread Matthew Pava
Hi Jamesie, I understand what you want, and I agree, in essence, that the fields should just be useable out of the box. I was just providing an alternative suggestion to creating a whole new fork of Django and if not that, at least some inspiration for what you want to include in that fork. --M

RE: Where are the folders of a virtual environment?

2017-04-23 Thread Matthew Pava
I know this doesn’t answer your question directly, but Windows XP is a really old OS and few software vendors support it anymore. Firefox stopped supporting it last September. You may want to switch to a Linux OS if you can’t afford to upgrade to a modern Windows OS. From: django-users@googl

RE: Displaying the multiple images in the product detail page

2017-04-25 Thread Matthew Pava
You could reference the images from your Product object like so: product.image_set.all() You may want to use models.ImageField, which inherits from models.FileField, instead of models.FileField For more information: https://docs.djangoproject.com/en/1.11/topics/db/examples/many_to_one/ https:/

RE: Can't get error to display when using inlineformset_factory.

2017-04-25 Thread Matthew Pava
Try using self.add_error('state': 'Must select state if province is not entered.') or raise ValidationError({'state': 'Must select state if province is not entered.'}) From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Andrew Michael Sent: Tuesday, April 2

RE: SelectDateWidget dosent work

2017-04-25 Thread Matthew Pava
Widget should be plural: widgets ={' birth_date': SelectDateWidget() } From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of kenton Fletcher Sent: Tuesday, April 25, 2017 3:46 PM To: Django users Subject: Re: SelectDateWidget dosent work This is the way I use

RE: please im new to django.Need help understanding small code of django poll app.Highlighted with ******************

2017-04-27 Thread Matthew Pava
You are creating a dictionary with the name “context”. A dictionary is initialized by surrounding key-value pairs in braces. { } The key and the value is separated by a colon. : The pairs are separated from each other by a comma. , Example: dictionary = { key1: value1, key2: value2, key3: value3

RE: Angular 2 + Django + Postgresql

2017-05-08 Thread Matthew Pava
There is a third-party app for Django and Angular called Djangular: https://github.com/appliedsec/djangular I have used neither Angular nor Djangular. I do use Windows 10 with PostgreSQL without any problems. You don’t need to create tables in PostgreSQL. Just run the migrate command. From: d

RE: Django Deployment showing list of directory

2017-05-08 Thread Matthew Pava
Hi Sarfaraz, Here is a compiled version of mod_wsgi for VC14: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of sarfaraz ahmed Sent: Monday, May 8, 2017 5:09 AM To: django-users@googlegroups.com Subject: D

RE: Django Deployment showing list of directory

2017-05-08 Thread Matthew Pava
mod_wsgi for python 2.7 with VC14 Regards, Sarfaraz Ahmed On 8 May 2017 at 18:44, Matthew Pava mailto:matthew.p...@iss.com>> wrote: Hi Sarfaraz, Here is a compiled version of mod_wsgi for VC14: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi From: django-users@googlegroups.com<mail

RE: Django Deployment showing list of directory

2017-05-08 Thread Matthew Pava
e24/htdocs/testarhamcollections" Require all granted ------ Still not working On 8 May 2017 at 18:58, Matthew Pava mailto:matthew.p...@iss.com>> wrote: Ah, I see. Well, why don’t you upgrade to Python 3.6? I did that last year and haven’t

RE: Django Deployment showing list of directory

2017-05-08 Thread Matthew Pava
" common Alias / "c:/Apache24/htdocs/testarhamcollections" Require all granted On 8 May 2017 at 19:46, Matthew Pava mailto:matthew.p...@iss.com>> wrote: You need to add the path to the Python executable, which ought to be in your virtual environment

RE: Django Deployment showing list of directory

2017-05-08 Thread Matthew Pava
amcollections.com<http://testarhamcollections.com> ErrorLog "C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-error.log" CustomLog "C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-access.log" common Alias / "c:/Apache24/htdocs/testa

<    1   2   3   4   >