Re: Is it possible to write generic module?

2017-03-27 Thread Det S. Pillner
Hi, many thanks. Your phrase 'yes, table name can a parameter to your function' fix my problem. I send table object (import in calling module - means: from app.models.tool import *) to my module. It works. So, import in config module is not required. You are the greatest. On Monday, March

Re: Update dict JsonField Postgresql

2017-03-27 Thread Martin Peveri
Perfect!! This code works: data = objectitem.data data[0]['processed'] = True objectitem.data = data objectitem.save() A last query that is not related to the insertion, but to the query. If I want to get only records processed in True as I have to do? This does not work, I get all the

Re: django sample projects

2017-03-27 Thread Siim Märtmaa
Browse projects by category from https://djangopackages.org/ also search repositories on github.com https://github.com/django/djangoproject.com https://github.com/pydanny/djangopackages https://github.com/mozilla/addons-server https://github.com/mozilla/bedrock https://github.com/PyCon/pycon

Re: django sample projects

2017-03-27 Thread Shahab Emami
i think if i study the code of other programmers it can help me a lot. i think one of the best way for me to be a real programmer is watching code of others. an integrated project that do something, i need that. ready source is big step for me that takes me a few years next. -- You received

Re: django sample projects

2017-03-27 Thread ludovic coues
An online market is nothing you can't do. There are form to add object, form to add object to a cart. Then you need to offer a view to the user so he can pay. The first result for me on google for "django paypal integration" is https://github.com/spookylukey/django-paypal. It's a reusable app

Re: Crear web apis con Django 1.6

2017-03-27 Thread Gustavo Andres Angulo
Hola Ariel, No es necesario migrar a la versión 1.7 para usar rest_framework, pero lo que si debes hacer es revisar la versión de rest_framework que soporta django 1.6 (en teoría debe ser la 3.0.0), Frente a la metodología hay bastante información

Re: django sample projects

2017-03-27 Thread Shahab Emami
i can set up a project. i want to see a real source code of a project. i can create a simple project . i need an example project. for example a source of an online market or anything else -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: django sample projects

2017-03-27 Thread Mark Phillips
Try "2 Scoops of Django" book. Shows uou how to set up a project. Mark On Mar 27, 2017 6:28 AM, "Shahab Emami" wrote: > hello > > i have question: > where can i find a few django sample projects? > i have seen a few tutorials and courses but i

Re: Django signup problem Urgent

2017-03-27 Thread Babatunde Akinyanmi
Hello Idowu. You were supposed to include your stack trace so that there can be a proper diagnosis of the problem. Now we can only guess. I guess you are submitting your form with the `description` field empty because your defined it with `blank=True` in your models.py. If you want to be able to

Re: Channels - get online users

2017-03-27 Thread Shahab Emami
don't you have any sample project? -- 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

Django signup problem Urgent

2017-03-27 Thread Idowu Julius
Hello everyone i would be glad if anybody can solve this problem with me. I am trying to signup users from AbstractUser model but after preparing the signup page i keep getting error of this field is required and i have checked error this is the model file https://ghostbin.com/paste/bk7y3 and

Re: Setup_environ before or after forking?

2017-03-27 Thread Chainz O.W.N
If you are still in need of a Django expert, have you checked out https://datepalm.engineering to see if they can help? They are Django experts from what I understand, and based in the US. On Wednesday, January 28, 2009 at 9:30:41 AM UTC+5, Malcolm Tredinnick wrote: > > On Tue, 2009-01-27 at

Crear web apis con Django 1.6

2017-03-27 Thread ariel gavegno
Cuál es la forma más eficiente de crear un web api con Django 1.6. Qué librerías existen o qué metodología podría utilizar ? Es imprescindible que migre mi framework a la versión 1.7 para utitlizar la libreria rest_framework ? Gracias por su ayuda. -- You received this message because you

Re: Update dict JsonField Postgresql

2017-03-27 Thread Melvyn Sopacua
Hi, On Monday 27 March 2017 08:50:04 Martin Peveri wrote: Totally forgot about this gotcha: > > > >>> objectitem.data[0]['processed'] = True That won't work. objectitem.data is a reference to a list of dicts changing something inside, doesn't signal the model that it's data has changed, as

Re: Channels - logout not resetting message.user value on new WebSocket connections

2017-03-27 Thread Andrew Godwin
To follow up on this - I have updated the spec ( http://channels.readthedocs.io/en/latest/asgi/www.html) to clarify exactly how accept works, added accept: False as an allowed value, and patched Daphne to work with that as of next release. Andrew On Mon, Mar 27, 2017 at 9:52 AM, Andrew Godwin

Re: Channels - logout not resetting message.user value on new WebSocket connections

2017-03-27 Thread Andrew Godwin
Or make "accept": False do the same as "close": True. The reason that close is a separate argument is that you can pass a WebSocket close code, optionally (we have a default if you don't, but that's probably enough for most people) Andrew On Mon, Mar 27, 2017 at 6:37 AM, Melvyn Sopacua

django sample projects

2017-03-27 Thread Shahab Emami
hello i have question: where can i find a few django sample projects? i have seen a few tutorials and courses but i don't now how a real project should be. then i need to see a few sample django codes . i now there are a lot of project in github but

Re: Update dict JsonField Postgresql

2017-03-27 Thread Martin Peveri
json.dumps return this (For example, the field contains 50k of records): [{'number': '1160188479', 'id': 0, 'content': 'hello', 'processed': False}, {'number': '1160188479', 'id': 1, 'content': 'hello', 'processed': False}, { 'number': '1160188479', 'id': 2,'content': 'hello', 'processed':

Re: Django Captcha Ajax call not working

2017-03-27 Thread valerio orfano
Hi Melvyn thanx a lot . I will try tomorrow early morning and will let u know. Thanx. valerio On Monday, March 27, 2017 at 3:31:38 PM UTC+2, Melvyn Sopacua wrote: > > Hi, > > > > {% if field.name = 'captcha' %} > > > > assigns 'captcha' to field.name and returns if that succeeded. So it's

Re: System check framework suiteable for monitoring?

2017-03-27 Thread guettli
Am Montag, 27. März 2017 11:31:22 UTC+2 schrieb Jani Tiainen: > > Hi, > > Checks framework is mainly built to prevent system starting management > commands in case of invalid state of the system. It's not meant for health > monitoring. > There exists several ways to run health checks - we use

Re: Update dict JsonField Postgresql

2017-03-27 Thread Melvyn Sopacua
Hi Martin, On Monday 27 March 2017 07:05:38 Martin Peveri wrote: > Hi Melvyn, With "not working", I mean that it does nothing. For > example > > This line > > >>> objectitem.data[0]['processed'] = True > > It does not return any errors > > This line: > >>> objectitem.save() > > Neither > >

Re: Update dict JsonField Postgresql

2017-03-27 Thread Martin Peveri
Hi Melvyn, With "not working", I mean that it does nothing. For example This line >>> objectitem.data[0]['processed'] = True It does not return any errors This line: >>> objectitem.save() Neither So when I'm going to get the record back, it returns me the same. >>> objectitem.data[0] >>>

Re: Update dict JsonField Postgresql

2017-03-27 Thread Melvyn Sopacua
On Monday 27 March 2017 05:56:34 Martin Peveri wrote: > But not working. > > Any Idea?. Plenty. But start by defining "not working". Not trying to be snarky, but there are a lot of moving parts here and it's anybody's guess at this point what part is causing the problem. We don't even know

Re: Is it possible to write generic module?

2017-03-27 Thread Melvyn Sopacua
On Monday 27 March 2017 05:41:28 Det S. Pillner wrote: > I work on tools for my job based on Django 1.8.17. In different > projects (with different databases) I use same routine to get some > data (config data). My problem is: the way is every time the same: > import model, get config data from

Re: Channels - logout not resetting message.user value on new WebSocket connections

2017-03-27 Thread Melvyn Sopacua
On Sunday 26 March 2017 15:40:28 Andrew Godwin wrote: > - The way to reject a socket connection is "close": True, not > "accept": False; try changing to that If there is no use case for 'accept': False, then it makes more sense to change the API to reply_channel.accept() and

Re: Django Captcha Ajax call not working

2017-03-27 Thread Melvyn Sopacua
Hi, {% if field.name = 'captcha' %} assigns 'captcha' to field.name and returns if that succeeded. So it's always true. You probably mean: {% if field.name == 'captcha' %} >From what you describe, testfield shows up and your template code says it >shouldn't show up. However, when debugging

unable to create a new project in django got error. Fatal error in launcher: Unable to create process using '"'

2017-03-27 Thread Camilo Torres
I think this have nothing to do with django. I suspect this is a bad python installation or bad django installation. I have no experience with installing python nor django on Windows 10, even though I can suggest you uninstall and clean both from your system, then do a fresh reinstall of python

unable to create a new project in django got error. Fatal error in launcher: Unable to create process using '"'

2017-03-27 Thread Camilo Torres
I think this have nothing to do with django. I suspect this is a bad python installation or bad django installation. I have no experience with installing python nor django on Windows 10, even though I can suggest you uninstall and clean both from your system, then do a fresh reinstall of python

Update dict JsonField Postgresql

2017-03-27 Thread Martin Peveri
Hi everyone, I have a model model like this: class ItemCampaign(models.Model): campaign = models.ForeignKey( Campaign, related_name="itemscampaign", verbose_name="Item campaña" ) data = JSONField(default=dict) def __str__(self): return self.campaign.name The field

Re: Is it possible to write generic module?

2017-03-27 Thread Avraham Serour
yes, table name can a parameter to your function what do you mean by "import this table"? On Mon, Mar 27, 2017 at 3:41 PM, Det S. Pillner wrote: > Hi all, > > I work on tools for my job based on Django 1.8.17. In different projects > (with different databases) I use same

Re: Django Captcha Ajax call not working

2017-03-27 Thread valerio orfano
testfield is where i type my captcha, sorry On Monday, March 27, 2017 at 2:38:15 PM UTC+2, valerio orfano wrote: > > Hi Melvyn thanx for ur reply, > > this is my form. > > class AjaxForm(forms.ModelForm): > captcha = CaptchaField() > class Meta: > model = ajaxModel >

Is it possible to write generic module?

2017-03-27 Thread Det S. Pillner
Hi all, I work on tools for my job based on Django 1.8.17. In different projects (with different databases) I use same routine to get some data (config data). My problem is: the way is every time the same: import model, get config data from database. The difference is: model name is in every

Re: Django Captcha Ajax call not working

2017-03-27 Thread valerio orfano
Hi Melvyn thanx for ur reply, this is my form. class AjaxForm(forms.ModelForm): captcha = CaptchaField() class Meta: model = ajaxModel exclude = [] class ajaxModel(models.Model): testfield = models.TextField(null=True, blank=True) If i don't use a ajaxmodel a get an

Re: Django Captcha Ajax call not working

2017-03-27 Thread Melvyn Sopacua
On Monday 27 March 2017 04:46:06 valerio orfano wrote: > {% if field.name = 'captcha' %} It may not make a difference if you only have one visible field, but this is not a comparison. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django

Re: Django Captcha Ajax call not working

2017-03-27 Thread valerio orfano
btw this is my html: {%csrf_token%} {{ form.non_field_errors }} {% for field in form.visible_fields %} {% if field.name = 'captcha' %} {{field}} {% endif %} {{ field.errors }} {% endfor %} {% for field in form.hidden_fields %} {{ field

Re: Django Captcha Ajax call not working

2017-03-27 Thread valerio orfano
Hi Andreas thak you very much. I've changed my html with the following: $(document).ready(function(){ $.ajaxSetup({ beforeSend: function(xhr, settings) { function getCookie(name) { var cookieValue = null;

Re: System check framework suiteable for monitoring?

2017-03-27 Thread Jani Tiainen
Hi, Checks framework is mainly built to prevent system starting management commands in case of invalid state of the system. It's not meant for health monitoring. There exists several ways to run health checks - we use quite simple setup with new relic. There also exists

Re: Django Captcha Ajax call not working

2017-03-27 Thread ludovic coues
You Ajax call have a suspicious "data: {}" in the middle of all the arguments. On 27 Mar 2017 10:23 am, "valerio orfano" wrote: Hi, I managed to make an ajax call. But the form is always invalid. IT is like the captcha field passed to the view is always empty. valerio

Re: Django Captcha Ajax call not working

2017-03-27 Thread Andréas Kühne
Hi, First of all - you are not sending anything to the form. $.ajax({ type: "POST", url: "../captcha", contentType: "application/json", data: {}, dataType: "json", success: function(data)

Re: Django Captcha Ajax call not working

2017-03-27 Thread valerio orfano
Hi, I managed to make an ajax call. But the form is always invalid. IT is like the captcha field passed to the view is always empty. valerio On Monday, March 27, 2017 at 8:48:17 AM UTC+2, valerio orfano wrote: > > I have the following class view taken from documentation: > > class

System check framework suiteable for monitoring?

2017-03-27 Thread guettli
I guess a lot of people here are not only developers, they are operators, too. I mean they need to care for a production system and ensure it is up and healthy. I am unsure if the System Check Framework[1] inside Django is suited to do monitoring checks. With "monitoring checks" I mean these

Re: Django channels, more than one project

2017-03-27 Thread Алексей Кузуб
Thank you very much, Andrew! It works for two independent layers. You are really cool and really helped me once again! =) пятница, 24 марта 2017 г., 16:25:42 UTC+3 пользователь Andrew Godwin написал: > > Run two Daphne instances, each with a different channel layer configured. > To make sure

Django Captcha Ajax call not working

2017-03-27 Thread valerio orfano
I have the following class view taken from documentation: class CaptchaView(CreateView): template_name = "captcha.html" form_class = MyForm def form_invalid(self, form): if self.request.is_ajax(): to_json_response = dict()