Re: Easy to use graphical reporting tools for SQL

2015-07-20 Thread
Maybe you can try navicat.
http://www.navicat.com/

2015-07-21 5:09 GMT+08:00 Kevin :

> In our office we have a Django application that uses a MySQL database.
> Often I am asked to produce various reports that can range from being basic
> dumps of query results or aggregate computations on query results. To do
> this I must connect to the Django shell to use the ORM or write the SQL
> directly. The problem is that it is impossible for the non-developers to
> access reports unless they ask a developer to create the queries, run them,
> and send the result back. This adds to lots of communication overhead and
> delays.
>
> Is there a basic free or open-source application that can connect to MySQL
> and allow non-developers to graphically build their own queries?
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6ab5432b-6a89-4942-b103-ca059dceaf98%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B7P_%2BsySnSBbTNhJPEDi5S%3DJEtoLdfTjVKaztdZYm7Low1N0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Easy to use graphical reporting tools for SQL

2015-07-20 Thread Kevin
In our office we have a Django application that uses a MySQL database. 
Often I am asked to produce various reports that can range from being basic 
dumps of query results or aggregate computations on query results. To do 
this I must connect to the Django shell to use the ORM or write the SQL 
directly. The problem is that it is impossible for the non-developers to 
access reports unless they ask a developer to create the queries, run them, 
and send the result back. This adds to lots of communication overhead and 
delays.

Is there a basic free or open-source application that can connect to MySQL 
and allow non-developers to graphically build their own queries?

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6ab5432b-6a89-4942-b103-ca059dceaf98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Label in Charfield

2015-07-20 Thread Carlos Andre
campo = forms.Charfield(max_lenght = 5, widget=(attr={'class':classe_css}))

2015-07-20 10:25 GMT-03:00 Ayush Jha :

> Create a widget for the CharField FormField
>
> http://stackoverflow.com/questions/4707192/django-how-to-build-a-custom-form-widget
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHGuwDymyci-CWmX6x5Vw7HYXfmtazxPGzJhZhFNiHgzdGH2VA%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA8yBMyo7rx5ftXuHk6o3EPuAx%2BQnh2C0jV_biBqBPXcDeeX6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Label in Charfield

2015-07-20 Thread Ayush Jha
Create a widget for the CharField FormField
http://stackoverflow.com/questions/4707192/django-how-to-build-a-custom-form-widget

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHGuwDymyci-CWmX6x5Vw7HYXfmtazxPGzJhZhFNiHgzdGH2VA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrate a many-to-many field to an explicit intermediate ("through") model?

2015-07-20 Thread Carsten Fuchs

Hi Gergely,

Am 16.07.2015 um 20:44 schrieb Carsten Fuchs:

3) change the m2m field by adding the through option, and add this
change to the migrations file.


[...]
And won't this last step trigger the same error as before? ("... you cannot 
alter to or
from M2M fields, or add or remove through= on M2M fields") ?


Would you mind clarifying and elaborating on your reply please?

Most importantly, why would step 3) not result in the same error as I originally 
experienced?


Many thanks and best regards,
Carsten

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55ACE8C2.7000508%40cafu.de.
For more options, visit https://groups.google.com/d/optout.


Re: 1.7 to 1.8 upgrade: test suite failing

2015-07-20 Thread simon . shillaker
Hi Tim,

Thanks again for the responses. Tom is now on holiday for a week but we'll 
pick up where he left off and try to replicate the issue in a minimal 
project.

Cheers,

Simon

On Wednesday, July 15, 2015 at 3:03:31 PM UTC+1, Tim Graham wrote:
>
> A minimal project to reproduce the issue would be helpful.
>
> On Wednesday, July 15, 2015 at 5:41:49 AM UTC-4, tom.sz...@eporta.com 
> wrote:
>>
>> Unfortunately, adding the super() calls didn't help.
>>
>> On Tuesday, July 14, 2015 at 12:47:02 PM UTC+1, Tim Graham wrote:
>>>
>>> Please try adding the super() calls.
>>>
>>> On Tuesday, July 14, 2015 at 5:44:09 AM UTC-4, tom.sz...@eporta.com 
>>> wrote:

 Hi, yes. Some of my test classes do use setUpClass() without calling 
 super().

 On Monday, July 13, 2015 at 5:44:03 PM UTC+1, Tim Graham wrote:
>
> Do your test classes use setUpClass() and/or tearDownClass()? If so, 
> are you missing super() calls in those methods?
>
> On Monday, July 13, 2015 at 9:37:03 AM UTC-4, tom.sz...@eporta.com 
> wrote:
>>
>> Thanks for the link
>> This is the commit at which my tests start failing:
>> da9fe5c Fixed #20392 -- Added TestCase.setUpTestData()
>>
>> On Monday, July 13, 2015 at 12:39:57 PM UTC+1, Tim Graham wrote:
>>>
>>> That's a starting point, but there are still a lot of commits 
>>> between 1.8 and 1.7.x. Here's what I meant by "bisecting the commit":
>>>
>>>
>>> https://docs.djangoproject.com/en/dev/internals/contributing/triaging-tickets/#bisecting-a-regression
>>>
>>> On Monday, July 13, 2015 at 5:50:49 AM UTC-4, tom.sz...@eporta.com 
>>> wrote:

 Thanks for the swift reply. The problem starts with Django 1.8.0. 
 My test suite passes on all 1.7.x versions.

 On Friday, July 10, 2015 at 2:32:25 PM UTC+1, Tim Graham wrote:
>
> No ideas, but if you could bisect to find the Django commit where 
> the problem started to appear that will probably help.
>
> On Friday, July 10, 2015 at 7:21:37 AM UTC-4, tom.sz...@eporta.com 
> wrote:
>>
>> Hi,
>>
>> I've recently tried upgrading from Django 1.7.6 to 1.8.3 but 
>> haven't been able to get my test suite to pass.
>>
>> My main problem is that all of the tests pass when run 
>> individually, but when run as an entire test suite, many arbitraily 
>> fail 
>> due to an *InterfaceError: connection already closed*:
>>
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py"
>> , line 838, in execute_sql
>> cursor = self.connection.cursor()
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py"
>> , line 164, in cursor
>> cursor = self.make_cursor(self._cursor())
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py"
>> , line 137, in _cursor
>> return self.create_cursor()
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", 
>> line 97, in __exit__
>> six.reraise(dj_exc_type, dj_exc_value, traceback)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py"
>> , line 137, in _cursor
>> return self.create_cursor()
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py"
>> , line 212, in create_cursor
>> cursor = self.connection.cursor()
>> InterfaceError: connection already closed
>>
>>
>>
>> I was previously using psycopg2.6 with Postgres 9.3 and have 
>> tried upgrading to psycopg2.6.1 with Postgres 9.4, but this hasn't 
>> helped.
>>
>> Forcing all my TestCase classes to inherit from SimpleTestCase 
>> resolves this issue, but inheriting from SimpleTestCase isn't 
>> something 
>> that I wish to do.
>>
>> Any help would be much appreciated.
>>
>> Thanks,
>>
>> Tom
>>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/27429be2-66e4-42a2-a1dc-da4640d322cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Label in Charfield

2015-07-20 Thread Info Test
Hello,
What is the best way to add class css for a label in Charfield form?
Thanks

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/797a4ebd-93a5-440b-929e-7f1652efe5bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem rendering media files in template during development

2015-07-20 Thread Charito Romeo
Oh, I forgot to include the MEDIA_ROOT = os.path.join(BASE_DIR, 'media') in
settings.py.

On Mon, Jul 20, 2015 at 3:16 PM, charito.romeo 
wrote:

> Hi django folks,
>
> I ran into a hiccup when I was rendering media files in templates during
> development. I wanted to render the image and the video that was uploaded
> by the user BUT instead of the contents of the image and the video being
> rendered,  the name of the file was rendered instead.
>
> I am using python 2.7.9 and django 1.8.3. Here are my  codes relevant to
> the question I'm asking:
>
> settings.py
>
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>
> STATIC_URL = '/static/'
>
> STATIC_PATH = (os.path.join(BASE_DIR, 'static'),
>'/var/www/static/',)
>
> STATICFILES_DIRS = (
> STATIC_PATH,
> )
> MEDIA_URL = '/media/'
>
>
>
>
> my models.py:
>
> class Entry(models.Model):
> VIDEO_ENTRY_TYPE = (
> ('SEMINAR', 'Seminar'),
> ('LECTURE', 'Lecture'),
> ('TALK', 'Talk'),
> )
> user = models.ForeignKey(User)
> video = models.FileField(upload_to='video_entries')
> entry_type = models.CharField(max_length=100, choices=VIDEO_ENTRY_TYPE)
> title = models.CharField(max_length=250)
>
>
> class EntryForm(ModelForm):
> class Meta:
> model = Entry
> fields = ['video', 'entry_type', 'title']
>
>
> my views.py:
> from django.shortcuts import render
> from django.http import HttpResponseRedirect
> from django.http import HttpResponse
> from django.views.generic import ListView
>
> from . models import User, Entry, EntryForm
>
> class IndexView(ListView):
> template_name = 'pi_app/index.html'
> context_object_name = 'latest_seminars'
>
> def get_queryset(self):
> return
> Entry.objects.filter(entry_type='SEMINAR').order_by('-pub_date') [:10]
>
> def get_context_data(self, **kwargs):
> context = super(IndexView, self).get_context_data(**kwargs)
> context['latest_lectures'] =
> Entry.objects.filter(entry_type='LECTURE').order_by('-pub_date') [:10]
> context['latest_talks'] =
> Entry.objects.filter(entry_type='TALK').order_by('-pub_date') [:10]
>
> my urls.py:
>
> from django.conf.urls import url
> from django.conf import settings
> from django.conf.urls.static import static
>
> from . import views
>
> urlpatterns = [
> url(r'^$', views.IndexView.as_view(), name='index'),
> url(r'^upload_file/$', views.upload_file, name='upload_file')
> ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>
>
> my template.py:
> 
>
> {% load staticfiles %}
>
> 
> 
> Homepage
> 
>
> 
>  Welcome {{ user }} 
>
>  
>
> {% block seminar %}
> 
>
> Most Recent Seminars
>
> {% if latest_seminars %}
> 
> {% for seminar in latest_seminars %}
>
> 
> 
> 
> {{ seminar.title }} by {{ seminar.user }}
> {% endfor %}
> 
> {% endif %}
> 
> {% endblock seminar %}
>
>
>
> Normally, the video or the image will be rendered. In my case, its not
> rendered. What is rendered instead is the name of the movie file
> (media/video_entries/name_of _movie_file)  or the name of the image file
>  (media/video_entries/name_of _image_file). All the other variables are
> rendered correctly  except the media files. What am I missing? Please
> enligthen me. Your help is hightly appreciated.  Thanks.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/66cb760a-96d3-4998-beec-1f6a947b9259%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM9Y-vsz6iYQzhQgukzeLdSMNCK39%2B9W8kpKSgOsUX2qa3%3DiMA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Problem rendering media files in template during development

2015-07-20 Thread charito.romeo
Hi django folks, 

I ran into a hiccup when I was rendering media files in templates during 
development. I wanted to render the image and the video that was uploaded 
by the user BUT instead of the contents of the image and the video being 
rendered,  the name of the file was rendered instead.

I am using python 2.7.9 and django 1.8.3. Here are my  codes relevant to 
the question I'm asking:

settings.py

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

STATIC_URL = '/static/'

STATIC_PATH = (os.path.join(BASE_DIR, 'static'),
   '/var/www/static/',)

STATICFILES_DIRS = (
STATIC_PATH,
)
MEDIA_URL = '/media/'




my models.py:

class Entry(models.Model):
VIDEO_ENTRY_TYPE = (
('SEMINAR', 'Seminar'),
('LECTURE', 'Lecture'),
('TALK', 'Talk'),   
)
user = models.ForeignKey(User)
video = models.FileField(upload_to='video_entries')
entry_type = models.CharField(max_length=100, choices=VIDEO_ENTRY_TYPE)
title = models.CharField(max_length=250)


class EntryForm(ModelForm):   
class Meta:
model = Entry
fields = ['video', 'entry_type', 'title']
 

my views.py:
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.views.generic import ListView

from . models import User, Entry, EntryForm

class IndexView(ListView):
template_name = 'pi_app/index.html'
context_object_name = 'latest_seminars'

def get_queryset(self):
return 
Entry.objects.filter(entry_type='SEMINAR').order_by('-pub_date') [:10]
 
def get_context_data(self, **kwargs):
context = super(IndexView, self).get_context_data(**kwargs)
context['latest_lectures'] = 
Entry.objects.filter(entry_type='LECTURE').order_by('-pub_date') [:10]
context['latest_talks'] = 
Entry.objects.filter(entry_type='TALK').order_by('-pub_date') [:10]

my urls.py:

from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static

from . import views

urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^upload_file/$', views.upload_file, name='upload_file')
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


my template.py:


{% load staticfiles %}



Homepage



 Welcome {{ user }} 

 

{% block seminar %}


Most Recent Seminars

{% if latest_seminars %}

{% for seminar in latest_seminars %}




{{ seminar.title }} by {{ seminar.user }}
{% endfor %}

{% endif %}

{% endblock seminar %}



Normally, the video or the image will be rendered. In my case, its not 
rendered. What is rendered instead is the name of the movie file 
(media/video_entries/name_of _movie_file)  or the name of the image file 
 (media/video_entries/name_of _image_file). All the other variables are 
rendered correctly  except the media files. What am I missing? Please 
enligthen me. Your help is hightly appreciated.  Thanks.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/66cb760a-96d3-4998-beec-1f6a947b9259%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there a plan to modernize Django-admin?

2015-07-20 Thread Derek
You can also look at http://djangosuit.com/ - works very well.  Free for 
non-commercial projects.  In the middle of an upgrade to Bootstrap 3.

On Saturday, 18 July 2015 11:18:49 UTC+2, xliiv wrote:
>
> Thanks for clarification, I'll check both: django-admin2 and 
> django-xadmin.
>
>
> On Sat, Jul 18, 2015 at 2:04 AM Russell Keith-Magee <
> rus...@keith-magee.com > wrote:
>
>> On Sat, Jul 18, 2015 at 2:54 AM, xliiv > > wrote:
>>
>>> Hi!
>>> Like the topic, though I don't mean only frontend.
>>> Backend could be also rewritten with for example class-based views and 
>>> other stuff used in regular Django apps?
>>> Would it be a waste? I'm just curious what is your opinion. :) 
>>>
>>
>> Hi Tymoteusz,
>>
>> As a volunteer project, what gets added to Django is whatever gets 
>> contributed. We don't make plans and then execute on those plans. I'm not 
>> aware of anyone who is actively working on a major rewrite/refactor of 
>> Django's admin at the moment.
>>
>> The state of Django's Admin is a topic that has been discussed many 
>> times, over many years. I don't think you'd get any disagreement that there 
>> is room for improvement; but it's also a big project. There have been a 
>> number of third party projects that propose to replace Django's admin (most 
>> notably django-admin2, but it's by no means the only project with this 
>> goal). 
>>
>> The key thing here is that a new admin could be entirely constructed as a 
>> third-party project. Django's existing admin doesn't do anything special - 
>> it's "just" a Django app, like any other. If you're particularly motivated, 
>> you could build your own Django admin using the tools that Django provides 
>> (and, as of 1.8, documents as official, stable API).
>>
>> For what it's worth, I've got my own crazy ideas about what a "new" 
>> Django admin would look like, which I've hinted at at various conferences 
>> (hunt down any of my conference talks about class based views). However, 
>> I'm not likely to get any time soon to look at this as a project - I've got 
>> plenty of other yaks that I'm shaving at the moment :-)
>>
>> Yours
>> Russ Magee %-)
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/A9g1ZODCg44/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAJxq849%2BATzYJXiB_cwZE6nw4-m52yfiFhJjTPjPFwOAHUChSg%40mail.gmail.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e3868a4f-1d8e-4d52-b06d-8982589462fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.