Code Monkey home page Code Monkey logo

django-material's Introduction

Django Material

Material design for Django.

IN ORDER TO REDUCE MAINTENANCE COST, THE PACKAGE FUNCTIONALITY HAS BEEN MOVED INTO THE django-viewflow

PLEASE, CONSIDE TO UPGRADE

$ pip install django-viewflow>=2.0.0b1

Django‐Material and Viewflow 1.x migration Guide

image

image

image

image

image

image

Join the chat at https://gitter.im/viewflow/django-material

  • Django-Material 1.10.x compatible with Django 2.2/3.0/3.1/3.2/4.0
  • Django-Material 1.[8,9].x compatible with Django 1.11/2.0/2.1/2.2/3.0/3.1/3.2
  • Django-Material 1.7.x compatible with Django 1.11/2.0/2.1/2.2/3.0/3.1
  • Django-Material 1.6.x compatible with Django 1.11/2.0/2.1/2.2/3.0
  • Django-Material 1.[3,4,5].x compatible with Django 1.11/2.0/2.1/2.2
  • Django-Material 1.2.x compatible with Django 1.11/2.0
  • Django-Material 1.1.x compatible with Django 1.8/1.9/1.10/1.11

Tested with:

image

Overview

  • Forms - New way to render django forms
    • Strong python/html code separation
    • Easy redefinition of particular fields rendering
    • Complex form layout support
  • Frontend - Quick starter template for modular admin-line applications development

image

Demo

http://forms.viewflow.io/

To checkout and run open source demo version locally, you need to have git and tox tools installed.

git clone https://github.com/viewflow/django-material.git
cd django-material

TOXENV=py36-dj111 tox -- python manage.py migrate --settings=demo.settings
TOXENV=py36-dj111 tox -- python manage.py loaddata demo/fixtures/* --settings=demo.settings
TOXENV=py36-dj111 tox -- python manage.py runserver --settings=demo.settings

Then you can go to http://127.0.0.1:8000/integration/ and login with admin:admin username and password to the demo site.

Documentation

http://docs.viewflow.io/material_forms.html

License

Django Material is an Open Source project licensed under the terms of the BSD3 license

Django Material Pro with additional features has a commercial-friendly license. Check http:viewflow.io/pro/ for details.

Changelog

1.10.0 2021-11-12

  • Drop support for python 2.7
  • Drop support for Django 1.11, Django 2.0, Django 2.1
  • Add support for Django 4.0
  • Keep viewset.queryset for detai and delete views
  • Improve multiple ajax select
  • Speed up model List View

django-material's People

Contributors

askvictor avatar bcanyelles avatar costela avatar dariaknyazeva avatar dependabot-preview[bot] avatar dependabot[bot] avatar edrmp avatar jlariza avatar kalekseev avatar kmmbvnr avatar lukasgarcya avatar luminousmen avatar marctc avatar markkohdev avatar matthewbdaly avatar morty avatar olivierdalang avatar ozbarshalom avatar r3gis3r avatar rajool avatar rikvdk avatar sallner avatar schampilomatis avatar shuuji3 avatar solarissmoke avatar synapticarbors avatar timgates42 avatar uy-rrodriguez avatar washeck avatar yottayocto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-material's Issues

Frontend fixes

[ ] fix spacing on breadcrumbs bar
[ ] fix back button spin cancel

issue with djcelery in admin panel: KeyError at /admin/djcelery/taskmeta/add/

Error during template rendering

In template /usr/local/lib/python2.7/dist-packages/material/templates/material/layout/fieldset.html, error at line 5
Key 'result' not found in 'TaskMetaForm'
1 {% load material_form_internal %}
2


3

4
{{ parent.label|default:"" }}

5
{% for element in parent.elements %}
{% render element %}
{% endrender %}{% endfor %}

6


7

8

Object history

The object history's page is not showing breadcrumb with default layout.

AttributeError: 'NoneType' object has no attribute 'tags'

Followed the install instructions but am getting this error stack trace:

mikeumus:~/workspace (master) $ sudo python ./manage.py runserver $IP:$PORT
/home/ubuntu/workspace/website/models.py:20: RemovedInDjango19Warning: Model class website.models.Service doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Service(models.Model):

/home/ubuntu/workspace/website/models.py:36: RemovedInDjango19Warning: Model class website.models.Issue doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Issue(models.Model):

/home/ubuntu/workspace/website/models.py:128: RemovedInDjango19Warning: Model class website.models.Bounty doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Bounty(models.Model):

/home/ubuntu/workspace/website/models.py:157: RemovedInDjango19Warning: Model class website.models.UserProfile doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class UserProfile(models.Model):

/home/ubuntu/workspace/website/models.py:20: RemovedInDjango19Warning: Model class website.models.Service doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Service(models.Model):

/home/ubuntu/workspace/website/models.py:36: RemovedInDjango19Warning: Model class website.models.Issue doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Issue(models.Model):

/home/ubuntu/workspace/website/models.py:128: RemovedInDjango19Warning: Model class website.models.Bounty doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Bounty(models.Model):

/home/ubuntu/workspace/website/models.py:157: RemovedInDjango19Warning: Model class website.models.UserProfile doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class UserProfile(models.Model):

Performing system checks...

System check identified some issues:

WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_CONTEXT_PROCESSORS.

System check identified 1 issue (0 silenced).
November 22, 2015 - 22:04:27
Django version 1.8.6, using settings 'coderbounty.settings'
Starting development server at http://0.0.0.0:8080/
Quit the server with CONTROL-C.
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Subject: [Django] ERROR (EXTERNAL IP): Internal Server Error: /
From: root@localhost
To: e, e
Date: Sun, 22 Nov 2015 22:04:33 -0000
Message-ID: <20151122220433.7622.38697@mikeumus-coderbounty-dev-2184777>

Internal Server Error: /
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ubuntu/workspace/website/views.py", line 44, in home
    response = render_to_response(template, context, context_instance=RequestContext(request))
  File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py", line 45, in render_to_response
    using=using)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 103, in render_to_string
    for engine in _engine_list(using):
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 143, in _engine_list
    return engines.all() if using is None else [engines[using]]
  File "/usr/local/lib/python2.7/dist-packages/django/template/utils.py", line 110, in all
    return [self[alias] for alias in self]
  File "/usr/local/lib/python2.7/dist-packages/django/template/utils.py", line 101, in __getitem__
    engine = engine_cls(params)
  File "/usr/local/lib/python2.7/dist-packages/django/template/backends/django.py", line 23, in __init__
    super(DjangoTemplates, self).__init__(params)
  File "/usr/local/lib/python2.7/dist-packages/django/template/backends/base.py", line 29, in __init__
    "Unknown parameters: {}".format(", ".join(params)))
ImproperlyConfigured: Unknown parameters: TEMPLATE_DEBUG

Request repr(): 
<WSGIRequest
path:/,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'csrftoken': '0VKW9LVHlFhwGHscFFn61083bcy6B3O2'},
META:{'CONTENT_LENGTH': '',
 'CONTENT_TYPE': 'text/plain',
 u'CSRF_COOKIE': u'0VKW9LVHlFhwGHscFFn61083bcy6B3O2',
 'DJANGO_SETTINGS_MODULE': 'coderbounty.settings',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HOME': '/home/ubuntu',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, sdch',
 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8,es;q=0.6',
 'HTTP_CACHE_CONTROL': 'max-age=0',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'csrftoken=0VKW9LVHlFhwGHscFFn61083bcy6B3O2',
 'HTTP_DNT': '1',
 'HTTP_HOST': 'coderbounty-dev-mikeumus.c9users.io',
 'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36',
 'HTTP_X_FORWARDED_FOR': '69.125.200.187',
 'HTTP_X_FORWARDED_PROTO': 'https',
 'HTTP_X_REGION': 'usw',
 'LANG': 'C',
 'LANGUAGE': 'C.UTF-8',
 'LC_ALL': 'C.UTF-8',
 'LOGNAME': 'root',
 'MAIL': '/var/mail/root',
 'PATH': '/home/ubuntu/.nvm/versions/node/v4.2.1/bin:/usr/local/rvm/gems/ruby-2.2.1/bin:/usr/local/rvm/gems/ruby-2.2.1@global/bin:/usr/local/rvm/rubies/ruby-2.2.1/bin:/mnt/shared/bin:/home/ubuntu/workspace/node_modules/.bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/mnt/shared/sbin:/opt/gitl:/opt/go/bin:/mnt/shared/c9/app.nw/bin:/usr/local/rvm/bin',
 'PATH_INFO': u'/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '10.240.0.28',
 'REMOTE_HOST': '',
 'REQUEST_METHOD': 'GET',
 'RUN_MAIN': 'true',
 'SCRIPT_NAME': u'',
 'SERVER_NAME': 'mikeumus-coderbounty-dev-2184777',
 'SERVER_PORT': '8080',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.7.6',
 'SHELL': '/bin/bash',
 'SUDO_COMMAND': '/usr/bin/python ./manage.py runserver 0.0.0.0:8080',
 'SUDO_GID': '1000',
 'SUDO_UID': '1000',
 'SUDO_USER': 'ubuntu',
 'TERM': 'screen',
 'TZ': 'UTC',
 'USER': 'root',
 'USERNAME': 'root',
 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fa6922c41e0>,
 'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x7fa68e359b48>,
 'wsgi.input': <socket._fileobject object at 0x7fa68e303ed0>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>
-------------------------------------------------------------------------------
Internal Server Error: /
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ubuntu/workspace/website/views.py", line 44, in home
    response = render_to_response(template, context, context_instance=RequestContext(request))
  File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py", line 45, in render_to_response
    using=using)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 103, in render_to_string
    for engine in _engine_list(using):
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 143, in _engine_list
    return engines.all() if using is None else [engines[using]]
  File "/usr/local/lib/python2.7/dist-packages/django/template/utils.py", line 110, in all
    return [self[alias] for alias in self]
  File "/usr/local/lib/python2.7/dist-packages/django/template/utils.py", line 101, in __getitem__
    engine = engine_cls(params)
  File "/usr/local/lib/python2.7/dist-packages/django/template/backends/django.py", line 23, in __init__
    super(DjangoTemplates, self).__init__(params)
  File "/usr/local/lib/python2.7/dist-packages/django/template/backends/base.py", line 29, in __init__
    "Unknown parameters: {}".format(", ".join(params)))
ImproperlyConfigured: Unknown parameters: TEMPLATE_DEBUG
Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
    return self.application(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/whitenoise/base.py", line 62, in __call__
    return self.application(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 189, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 218, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 261, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 97, in technical_500_response
    html = reporter.get_traceback_html()
  File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 382, in get_traceback_html
    t = DEBUG_ENGINE.from_string(TECHNICAL_500_TEMPLATE)
  File "/usr/local/lib/python2.7/dist-packages/django/template/engine.py", line 153, in from_string
    return Template(template_code, engine=self)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 191, in __init__
    self.nodelist = engine.compile_string(template_string, origin)
  File "/usr/local/lib/python2.7/dist-packages/django/template/engine.py", line 260, in compile_string
    parser = parser_class(tokens)
  File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 35, in __init__
    super(DebugParser, self).__init__(lexer)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 303, in __init__
    self.add_library(lib)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 417, in add_library
    self.tags.update(lib.tags)
AttributeError: 'NoneType' object has no attribute 'tags'
[22/Nov/2015 22:04:33] "GET / HTTP/1.1" 500 59

:|

404 error when trying to add a related (FK) object

In my model form i have some FK to another models, and when trying to add them in the admin, i got a 404 error. The problem seems to be at:

(firefighters-hq) [edvm@laptop material]$ grep -R '%s%s' ./*

. /admin/templates/material/fields/django_relatedfieldwidgetwrapper.html:

I have attached a screenshot, when i click '+' i got the 404 error. Unfortunatly i dont know how to fix this issue to send a pr :-\

screenshot from 2015-05-05 08 34 09

[Django] ERROR (EXTERNAL IP): Internal Server Error: /admin/auth/user/3/password/

File "/srv/forms.viewflow.io/.tox/django18_py27/local/lib/python2.7/site-packages/django/templatetags/i18n.py", line 353, in top
value = self.value()
File "/srv/forms.viewflow.io/.tox/django18_py27/local/lib/python2.7/site-packages/django/template/base.py", line 525, in value
(i, subject))
TemplateSyntaxError: Searching for value. Unexpected end of string in column 22: trans 'Change password

Change password

I try change password and show this error: Invalid block tag: 'form', expected 'endblock'.

Use of permission_required

The module does not generate dynamic urls depending on the user's permission
Logged.
Also when the user is not logged you are presenting error accessing the url.

Support autocomplete-light

Hi !

I love django-material, but it doesn't seem to support autocomplete foreign key widgets. That's a deal breaker as soon as there's a model with lot of instances, which happens pretty often.
I guess the best would be to support django-autocomplete-light !

Awesome work by the way, the UI is gorgeous ! I really hope I can adopt it !

404 "/admin/{% static" in base.html

 <script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>

"admin" => 'admin'

Overriding TextAreas (when using django-ckeditor)

Hi,

For my project I've been looking for django admin interfaces, I'm coding my own blog with Django and I'll use the django admin to write my posts.
The thing is that I'll want some of my friends to use this backend part of django, and the original display isn't that rookie friendly.

So basicly I found django-admin-bootstrapped, django-suit, and django material.

I'm using django-ckeditor to be able to use RichTextFields to write the content of a post.
Thing is that the RichTextField doesn't display the CK editor when I'm using django material.

So what I'm basicly asking : Is the support of django ck editor and the display of their RichTextField planned ?

Thank you.

(Otherwise I'll be using django-suit)

SplitDateTime widget issues

  File "/srv/forms.viewflow.io/material/templatetags/material_form_internal.py", line 79, in multiwidget_value
    return bound_field.field.widget.decompress(bound_field.value())[pos]
  File "/srv/forms.viewflow.io/.tox/py27/local/lib/python2.7/site-packages/django/forms/widgets.py", line 876, in decompress
    value = to_current_timezone(value)
  File "/srv/forms.viewflow.io/.tox/py27/local/lib/python2.7/site-packages/django/forms/utils.py", line 175, in to_current_timezone
    if settings.USE_TZ and value is not None and timezone.is_aware(value):
  File "/srv/forms.viewflow.io/.tox/py27/local/lib/python2.7/site-packages/django/utils/timezone.py", line 339, in is_aware
    return value.tzinfo is not None and value.tzinfo.utcoffset(value) is not None

AttributeError: 'list' object has no attribute 'tzinfo'

'material_admin' is not a valid tag library: ImportError raised loading material.admin.templatetags.material_admin: No module named ...

Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.6
Exception Type: TemplateSyntaxError
Exception Value:
'material_admin' is not a valid tag library: ImportError raised loading material.admin.templatetags.material_admin: No module named apps
Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in load, line 1084
Python Executable: /usr/bin/python2.7
Python Version: 2.7.9
Python Path:
['/home/mohammad/github/DCIIM',
'/home/mohammad/github/DCIIM',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7']

have you any idea where this came from? https://github.com/mrafieee/DCIIM

DecimalField with input type number has separator comma

I have my LANGUAGE_CODE with pt-br and the tag html language has en-us then my field has value decimal with comma separator. When I use django admin without material the value show normal in form but the material not is showing.

missing actions

Hi,
in the admin the actions are missing.
the same goes for the checkboxes.

Forms are not responsive.

Hi admin,

Forms aren't responsive and are aligning out of the screen when viewed on mobile. I tried everything I could. I haven't changed any CSS and followed the forms code you provided here.

Overflow hidden in filters

in https://github.com/viewflow/django-material/blob/master/material/admin/templates/admin/change_list.html (line 56 - 75)

    <div class="col s12 m4 l3">
        <div class="card filters" style="overflow: visible">
            <div class="card-content">
                <span class="card-title black-text" style="margin-bottom:20px">Filters</span>
                {% block search %}{% search_form cl %}{% endblock %}

                {% block filters %}
                {% if cl.has_filters %}
                <div id="changelist-filter row">
                    {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
                </div>
                {% endif %}
                {% endblock %}

                {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
                <div class="clearfix"></div>
            </div>
            <div class="card-action">&nbsp;</div>
        </div>
    </div>

causes a problem to any list_filter that is sufficiently long to overflow the filters card content.

In images :

We have this
screen shot 2015-10-30 at 17 37 40

And we should have this :
screen shot 2015-10-30 at 17 38 05

I fixed it for the picture by inserting and inline style to ...<div class="card filters" style="overflow: visible">... but I am not sure this is the most permanent solution to make the suggestion. Overflow is ordered to hide by the card class, from materialize.css.

.card {
  position: relative;
  overflow: hidden;    <--- HERE
  margin: 0.5rem 0 1rem 0;
  background-color: #fff;
  border-radius: 2px;
}

Maybe declaring the filters class in https://github.com/viewflow/django-material/blob/master/material/admin/static/material/admin/css/base.css (line 240) would be best (it's currently used only by its children).

.filters {
    overflow: visible;
}

Invalid filter: 'pjax' in profile page

Dear all,

I followed the quickstart steps and accesing the admin->profile gives the folowing error:
Invalid filter: 'pjax'
1

  {% extends 'material/frontend/base_site.html,material/frontend/base_pjax.html'|pjax:request %}

2
3 {% block title %}{{ current_module.label }} - {{ block.super }}{% endblock %}

the same error on /accounts/profile/ page.

Please help me with this issue.

BR,
Alecs

Inherited fields not visible in admin forms

I have the following in forms.py

class ContactForm(autocomplete_light.ModelForm):
    class Meta:
        model = Contact
        fields = '__all__'

and in admin.py

class ContactAdmin(ModelAdminWithReadOnly):
    list_display = (
        'first_name', 'last_name', 'title', 'email', 'account',
        'attendee_count',
    )
    search_fields = (
        'id', 'first_name', 'last_name', 'email', 'account__name', 'title',
        'department',
    )

    readonly_fields = ('id', 'modified',)
    fields = (
        'id', 'account', 'first_name', 'last_name', 'title', 'department',
        'email', 'phone', 'mobile_phone', 'twitter', 'picture_url',
        'linked_in', 'how_heard', 'notes', 'modified'
    )

    inlines = (BookingInline, AttendeeInline,)

    form = ContactForm

When I try to run, I get:

ERROR [django.request:256] Internal Server Error: /admin/apricot/contact/12706/
Traceback (most recent call last):
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
    response = response.render()
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/response.py", line 158, in render
    self.content = self.rendered_content
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/response.py", line 135, in rendered_content
    content = template.render(context, self._request)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
    return self.template.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 209, in render
    return self._render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/loader_tags.py", line 135, in render
    return compiled_parent._render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/loader_tags.py", line 65, in render
    result = block.nodelist.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/templatetags/material_form.py", line 101, in render
    return template.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
    return self.template.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 211, in render
    return self._render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/templatetags/material_form.py", line 152, in render
    value = self.nodelist.render(context).strip()
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/defaulttags.py", line 329, in render
    return nodelist.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/templatetags/material_form.py", line 152, in render
    value = self.nodelist.render(context).strip()
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/templatetags/material_form_internal.py", line 64, in render
    return element.render(context, **options)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/base.py", line 34, in render
    return template.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
    return self.template.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 211, in render
    return self._render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/defaulttags.py", line 217, in render
    nodelist.append(node.render(context))
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/templatetags/material_form_internal.py", line 64, in render
    return element.render(context, **options)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/base.py", line 34, in render
    return template.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
    return self.template.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 211, in render
    return self._render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/template/defaulttags.py", line 217, in render
    nodelist.append(node.render(context))
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/templatetags/material_form_internal.py", line 64, in render
    return element.render(context, **options)
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/material/base.py", line 144, in render
    bound_field = form[self.field_name]
  File "/srv/sites/myportal/env/lib/python2.7/site-packages/django/forms/forms.py", line 167, in __getitem__
    "Key %r not found in '%s'" % (name, self.__class__.__name__))
KeyError: u"Key 'id' not found in 'ContactForm'"

If I remove the id and modified fields from ContactAdmin, the problem goes away. The model inherits those from the base classes it extends. So the problem appears to be only with inherited fields on the model.

Django 1.8 admin template rendering error

After following the steps on the docs (http://docs.viewflow.io/django_material.html), I get the following error when using Django 1.8:

AttributeError at /admin/
'str' object has no attribute 'user'
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.8.3
Exception Type: AttributeError
Exception Value: 'str' object has no attribute 'user'

The debug page says that the occurs in line 60 of 'material\admin\templates\admin\base.html', which reads:
{% get_app_list request as app_list %}

Looking into the issue further, I have noticed that the error is actually in line 25 of 'material\admin\templatetags\material_admin.py', which reads:
user = request.user

This is an issue, as the variable 'request' contains no value at that point.

Please can you advise how to fix this error.

Thanks,
--Matt

CheckboxSelectMultiple not displaying checkboxes

I'm using a ModelForm, my 'Person' model has a ManyToMany relationship with 'Problem' and I've set the form to show checkboxes as so

class PersonForm(forms.ModelForm):
    class Meta:
        model = Person
        exclude = ('',)
        widgets = {
            'problems': forms.CheckboxSelectMultiple(),
        }

But it doesn't show checkboxes with Material Form, instead it shows a MultipleSelect
With Material

Removing the Material template shows up the checkboxes
Without Material

Layout overrides "part" HTML tag content

I'm overriding the HTML for a part of the ModelForm to create CheckBoxes instead of a MultiSelect like so

{% part form.problems %}
<label>Problem</label> <p>
{% for problem in form.problems %}
{{ problem.tag }} <label for="{{ problem.id_for_label }}">{{ problem.choice_label }}</label> <p>
{% endfor %}

And it shows up just fine -

Without layout

However, on adding a layout to the forms.py file it overrides the part and shows up as a MultiSelect like this -

With

ManagementForm data is missing or has been tampered with

I've tried to install django material in our project, mainly for the admin part. Templates are really good, but it seems django-material brokes some part of the form logic. When saving any model through the admin, we get the following error: ManagementForm data is missing or has been tampered with.

Complete stack trace can be found below:

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/en/admin/auth/user/1/

Django Version: 1.7.4
Python Version: 3.4.0
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'material',
'material.admin',
'treebeard',
'mptt',
'djangocms_text_ckeditor',
'cms',
'menus',
'sekizai',
'djangocms_admin_style',
'django.contrib.admin',
'ourproject',
'cachalot',
'waffle',
'rest_framework',
'guardian',
'hvad',
'cities_light',
'autocomplete_light',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'djcelery',
'rosetta',
'debug_toolbar',
'autofixture')
Installed Middleware:
('debug_toolbar.middleware.DebugToolbarMiddleware',
'ourproject.middleware.SetRemoteAddrMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',)


Traceback:
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/contrib/admin/options.py" in wrapper
583.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/utils/decorators.py" in _wrapped_view
105.                     response = view_func(request, *args, **kwargs)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
52.         response = view_func(request, *args, **kwargs)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/contrib/admin/sites.py" in inner
206.             return view(request, *args, **kwargs)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/contrib/admin/options.py" in change_view
1456.         return self.changeform_view(request, object_id, form_url, extra_context)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/utils/decorators.py" in _wrapper
29.             return bound_func(*args, **kwargs)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/utils/decorators.py" in _wrapped_view
105.                     response = view_func(request, *args, **kwargs)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/utils/decorators.py" in bound_func
25.                 return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/db/transaction.py" in inner
394.                 return func(*args, **kwargs)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/contrib/admin/options.py" in changeform_view
1403.             if all_valid(formsets) and form_validated:
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/forms/formsets.py" in all_valid
438.         if not formset.is_valid():
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/forms/formsets.py" in is_valid
303.         self.errors
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/forms/formsets.py" in errors
277.             self.full_clean()
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/forms/formsets.py" in full_clean
324.         for i in range(0, self.total_form_count()):
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/forms/formsets.py" in total_form_count
114.             return min(self.management_form.cleaned_data[TOTAL_FORM_COUNT], self.absolute_max)
File "/home/user/.local/share/virtualenvs/ourproject/lib/python3.4/site-packages/django/forms/formsets.py" in management_form
96.                     code='missing_management_form',

Exception Type: ValidationError at /en/admin/auth/user/1/
Exception Value: ['ManagementForm data is missing or has been tampered with']

django 1.8 support

as per doc its tested with dj 1.6 and 1.7. dj 1.8 is stable and LTS. is that supported now?

jQuery is not defined

I installed django 1.9, on python 3.4. I copied the first form example from http://forms.viewflow.io/.
When I run python manage.py runserver the dropdown for gender is not showing and the hover texts for fields is over the text I input.

When I inspect the page there is an error:

Uncaught ReferenceError: jQuery is not defined(anonymous function) @ jquery.datetimepicker.js:1631
jquery.formset.js:224 Uncaught ReferenceError: jQuery is not defined(anonymous function) @ jquery.formset.js:224
materialize.js:44 Uncaught ReferenceError: jQuery is not defined(anonymous function) @ materialize.js:44
material_init.js:5 Uncaught ReferenceError: $ is not defined(anonymous function) @ material_init.js:5

Any help?

Issue with formwizard rendering.

My attempt at integrating with form-wizard for multistep forms is as below

{% extends "base.html" %}
{% load material_form %}
{% block content %}
<form  action="" method="post">
    {% csrf_token %}
    {{ wizard.management_form }}
    {% if wizard.form.forms %}
        {{ wizard.form.management_form }}
            {% for form in wizard.form.forms %}
                {% form form=form %}{% endform %}
            {% endfor %}
    {% else %}
        {{ wizard.form }}
    {% endif %}
    <input type="submit" value="Proceed" />
</form>
{% endblock %}

with the base.html as here http://pastebin.com/uUZT40ge . with simple forms such as the one below it works ok :

{% extends "base.html" %}
{% load i18n material_form %}
{% block content %}
<form  action="" method="post">
    {% csrf_token %}
    {% form form=form %}{% endform %}
    <input type="submit" value="Proceed" />
</form>
{% endblock %}

however with the multiple step displays the first form only and on submit does not proceed to the next step.Without the styling it works as expecting moving step->step through the forms to the final one.

Contributing by adding formsets: little bit of guidance

Hi! First of all: awesome project, first thing i thought about when I learned about Google's Material design.

I don't have an issue but I didn't know where to put this, so I figured I'd do it here.

I'd like to build out some missing parts of the Admin, I want it in one of my projects and would love to be able to offer this design to my clients. I've forked and integrated the project as a dev version in a current project, and ran into the missing formsets thing and I'd like to start there!

I was hoping someone could point me in the right direction for adding formsets, it would save me quite some time figuring out how the Admin internals work. If not, no problem, I'll do it anyway but it'll take me a little bit longer :) I'll take a look at the issues as well to see if I can fix a couple of them while I'm at it.

I'd be happy to write a small contributing guide in the process to try to give the project a boost.

Let me know if help is welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.