Re: Django Generic Date Views

2018-08-08 Thread Gerald Brown
As far as I know both "vi" and "queryset" are variable names and can be called "anything" On Thursday, August 9, 2018 at 12:08:07 AM UTC+8, Jason wrote: > > also, I note you don't set the queryset field in your view class. you set > it to `vi`. that's probably an issue there > > eg > > from

Re: django models

2018-08-08 Thread Ramandeep Kaur
i set the secret key but its again giving me the same errror. django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty. On Wed, Aug 8, 2018 at 7:24 PM, Matthew Pava wrote: > Well, you could generate a SECRET KEY here: > >

Re: django models

2018-08-08 Thread Balasriharsha Cheeday
You must have removed the secret key in settings.py file, try re-adding that secret key, then it should work just fine On Tuesday, August 7, 2018 at 10:17:00 AM UTC-7, Ramandeep Kaur wrote: > > My question is that how to delete models in django? > -- You received this message because you are

Select "class" attributes are not updated

2018-08-08 Thread matteo gassend
Hello everyone, I am trying to personalize my select fields in a django modelform, however the changes are not reflected when I try to render the field. Anyone else ever had this problem? self.fields["prodotti_var"].widget.attrs.update({"class" : "form-control m-bootstrap-select

Re: django models

2018-08-08 Thread Ramandeep Kaur
I am new at Django so I don't know how to create secret key. please explain me. On Wed, Aug 8, 2018, 1:20 PM Gerald Brown wrote: > The last line of the error message tells you what to do. Create a Secret > Key in your settings.py file because it says it is now empty. > > On Wednesday, 08

RE: django models

2018-08-08 Thread Matthew Pava
Well, you could generate a SECRET KEY here: https://www.miniwebtool.com/django-secret-key-generator/ Then in your settings.py file you need to add this line: SECRET_KEY = “[insert secret key here]” https://docs.djangoproject.com/en/dev/ref/settings/#secret-key From:

how to django query objects parse in json below format please help me

2018-08-08 Thread arvind yadav
my Quey objects is jsonquery = PartDetails.objects.all() { title:{ text: " march 2018 " ### is time }, data: [{ type: "column", dataPoints: [ { label: "sv", y: 3}, ] }, { type: "line",

Re: django models

2018-08-08 Thread Gerald Brown
The last line of the error message tells you what to do.  Create a Secret Key in your settings.py file because it says it is now empty. On Wednesday, 08 August, 2018 02:43 PM, Ramandeep Kaur wrote: when i run this ./manage.py makemigrations it gives some error. Don't know what to do.

Re: django models

2018-08-08 Thread Ramandeep Kaur
when i run this ./manage.py makemigrations it gives some error. Don't know what to do. Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 353, in

Re: Django Generic Date Views

2018-08-08 Thread Jason
are you sure your url is in admin/visit? path('today/', PaymentTodayArchiveView, name="today"), 404 says you have a url routing issue, not a view issue. On Wednesday, August 8, 2018 at 8:42:06 AM UTC-4, Gerald Brown wrote: > > > > On Wednesday, August 8, 2018 at 8:15:21 PM UTC+8, Jason wrote:

Re: Django Generic Date Views

2018-08-08 Thread Jason
also, I note you don't set the queryset field in your view class. you set it to `vi`. that's probably an issue there eg from django.views.generic.dates import TodayArchiveView from myapp.models import Article class ArticleTodayArchiveView(TodayArchiveView): queryset =

Re: Select "class" attributes are not updated

2018-08-08 Thread Luis Polanco
Hi If you are only updating the class attribute you can do a direct assignment to the class attribute on the dictionary like: self.fields['attendant_authority'].widget.attrs['class'] = 'select_autoridad' self.fields["prodotti_var"].widget.attrs["class"] = "form-control m-bootstrap-select

Re: how to convert django query objects in blow formal json

2018-08-08 Thread SACHIN CHAVAN
Did you mean to say Django queryset? right? On Wed, Aug 8, 2018 at 4:04 PM arvind yadav wrote: > > > *how to convert django query objects in blow formal js*on > > > { > title:{ > text: " march 2018 " > }, > data: [{ > type: "column", > dataPoints: [ >

how to convert django query objects in blow formal json

2018-08-08 Thread arvind yadav
*how to convert django query objects in blow formal js*on { title:{ text: " march 2018 " }, data: [{ type: "column", dataPoints: [ { label: "sv", y: 3}, ] }, { type: "line",

Re: how to convert django query objects in blow formal json

2018-08-08 Thread SACHIN CHAVAN
use Django rest framework, user serializers for converting queryset into the JSON format -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Django Generic Date Views

2018-08-08 Thread Gerald Brown
Greetings: Tonight I discovered something at https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-date-based/ that I thought is just what I am looking for. The only problem is I can't get them to work. They are designed to present views by Year, Month, Week, Day, Today or

Re: Django Generic Date Views

2018-08-08 Thread Jason
what have you tried so far? What issues are you having with the documentation examples? "can't get them to work" is really uninformative, -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Django Generic Date Views

2018-08-08 Thread Gerald Brown
On Wednesday, August 8, 2018 at 8:15:21 PM UTC+8, Jason wrote: > > what have you tried so far? What issues are you having with the > documentation examples? > > "can't get them to work" is really uninformative, RIGHT. > What I tried was the TodayArchiveView by following the docs. When I

Upgrading from Django 1.7: render_to_response and context_instance

2018-08-08 Thread Hanne Moa
I'm upgrading a rather large code base from django 1.7, with the ultimate goal to have it run on 1.11, as the code isn't fully verified to run on python 3 yet. I'm replacing `render_to_response()` with `render()` everywhere a RequestContext is used, and came upon this (simplified) oddity: return

RE: Upgrading from Django 1.7: render_to_response and context_instance

2018-08-08 Thread Matthew Pava
If you are simply adding something to most every request, I would add a context processor in the TEMPLATE settings. Check out https://docs.djangoproject.com/en/2.1/topics/templates/#context-processors In this example, I have an app called general. Within that is a py file called