Re: Newforms 'preferred practice'
Felix Ingram wrote: > 3. Binding data - I'd like the form to handle editing of an instance. > I could construct a dictionary of values and pass it to the form as > per the docs but I'd like to just pass a model instance and have the > form sort things out. Is this advisable? If so then does anyone have > any pointers about what methods I need to implement? You can use the model instances __dict__: my_form = CreateForm(initial=model_instance.__dict__) Saves copying each field into a seperate dict or implementing any extra methods in your form. Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
django channels in the shell
I'm trying to implement a custom management command into my app. its purpose would be to check the database for a poll which fits time parameters and update clients via channels. I want to get a list of the clients in a group, then decide whether or not to send them new information based on their session data I have been exploring this in the shell and im wondering why my client doesn't receive a message when i use the following code: from django.conf import settings from django.utils.module_loading import import_string config = getattr(settings, "CHANNEL_LAYERS", {}) backend_class = import_string(config['default']['BACKEND']) channel_layer = backend_class(config['default'].get("CONFIG", {})) channel = channel_layer.group_channels('poll')[0] channel_layer.send(channel, {"text": "hello world!"}) -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/643c74f3-6703-4fc4-bf1e-4fa2c327ef1e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Error using url in django template language
hey you tried: you app name is links rather than myapp, so try: -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ff9b710a-cd63-456b-b455-fe8cf3a58d1b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django template language resolve url
hey xyron.. i replied to your other thread your namespace should actually just be links so the answer should be: -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1c2e59f8-9850-415b-947e-97eaa5cddc72%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django template language resolve url
sorry i typed an s in there, here is that code amended > > -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2d5bcf19-2c0b-40a6-8ed4-5e27d4940ab8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: django channels in the shell
solved it.. I had to explicitly add the hosts parameter from django.conf import settings > from django.utils.module_loading import import_string config = getattr(settings, "CHANNEL_LAYERS", {}) > hosts = config['default']['CONFIG']['hosts'] backend_class = import_string(config['default']['BACKEND']) > channel_layer = backend_class(hosts=hosts) > channel = channel_layer.group_channels('poll')[0] channel_layer.send(channel, {"text": "hello world!"}) -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b4e8cb61-4428-48d6-aeb9-463e21398dfe%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: django channels in the shell
thank you. i completely overlooked that function -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/39fab2c2-f63f-4761-9775-1e4ceb752a93%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: import error: no module named viewflow.frontend
did you add 'viewflow.frontend' to installed_apps? -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/be562e55-25fb-45df-b4a5-f58dbf75aa7b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Daphne does not handle wss requests
I too experience this in my local development environment I find secure web sockets throwing an error in the browser console when attempting to send a message: InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable. I had attributed this to django being in debug mode, not serving secure http and thus not supporting secure ws -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5fffcbf2-a252-413d-b444-a7c2a4381761%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: group by 3 fields
there is a model meta option called ordering. you can specify a list of fields to order by docs found at: https://docs.djangoproject.com/en/1.10/ref/models/options/#ordering i have only used this in the admin -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f6bb715f-17e8-4935-9878-2dc6b3f6c3cb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error
there is a lack of information here, though you last post suggests maybe you missed a couple of template tags at the start of you index.html add: {% load staticfiles %} and then when adding you scripts use: -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a87d42ff-b73d-4c59-b384-e77a5a52971d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Issue using django-admin
if you are new to django you don't want to download the development edition, this is more for contributing firstly you need pip. secondly, do your self a huge favour and install virtualenv and read the getting started docs now rather than later once you have made a virtualenv directory and made it your current directory, you with need to activate the environment. run pip install django you shouldn't have a problem from here running the relevant django commands -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6786d674-d199-4f3a-8677-d9a96f568539%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: USING graphs in django admin
i have used d3.js in a template and past it data when answering a http request with a view i found d3.js a little interesting to wrap my head around but it is a good tool not used it with the admin though -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a7b4bec2-1a77-4be3-bcdf-e3f3a00c3b79%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: new to Django
+1 ludovic -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/44e18a1e-1aa0-4c8e-a85e-02d370d5536f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: new to Django
+1 ludovic -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/47841fde-c966-41fd-9223-698e4c8220ea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: new to Django
+1 ludovic -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/99d48d6e-1896-4493-94e5-fd18a2561550%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Meta class completely missing.
hi brandon try removing (object) from your meta class declaration -- 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 email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/30d054d7-8150-4eeb-bc3b-cf8a762078ae%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.