darklow / django-suit-examples Goto Github PK
View Code? Open in Web Editor NEWThis repository is only for source code of Django Suit project demo application, not the whole Django Suit.
Home Page: http://djangosuit.com/
This repository is only for source code of Django Suit project demo application, not the whole Django Suit.
Home Page: http://djangosuit.com/
I'd like to see an example for styling of widget that appears as an editable item in a list (as part of http://django-suit.readthedocs.io/en/develop/list_attributes.html#list-cell-attributes).
I have tried this:
def suit_cell_attributes(self, obj, column):
if column == '_duration_days':
return {'class': 'text-center'}
if column == 'planned_month':
return {'widget': TextInput(attrs={'class': 'text-center input-mini'})}
(with planned_month
appearing in the list_editable
list, of course).
The result does not seem to indicate any styling change for planned_month
(but duration_days
works).
The website says non-commercial version can be obtained from github, but there seems that the assets (css, js) are missing from this repo.
I'm following the admin.py example and can't seem to get select2 working with django-suit. Considering the following admin.py config any ideas on what I am missing? This is for a tags module I'm putting together to add searchability based on tagged content to a model called accounts. Would be useful in a bunch of other areas on my app but this is the quickest to work on currently. Screenshot of my accounts form...showing the legacy select method.
admin.py
from django.contrib import admin
from accounts.models import *
from inventory.models import *
from services.models import *
from tags.models import *
from import_export.admin import ImportExportModelAdmin
from import_export import resources
from django_select2 import *
from django.forms import TextInput, ModelForm, Textarea, Select
class TagChoices(AutoModelSelect2Field):
queryset = tag.objects
search_fields = ['tag', ]
class TagsForm(ModelForm):
tag_verbose_name = tag._meta.verbose_name
country = TagChoices(
widget=AutoHeavySelect2Widget(
select2_options={
'width': '220px',
'placeholder': 'Lookup %s ...' % tag_verbose_name
}
)
)
class AccountsGeneral(admin.TabularInline):
model = account
suit_classes = 'suit-tab suit-tab-general'
class AccountsServices(admin.StackedInline):
model = service
suit_classes = 'suit-tab suit-tab-services'
extra = 0
can_delete = False
class AccountsNotes(admin.TabularInline):
model = note
suit_classes = 'suit-tab suit-tab-general'
extra = 0
can_delete = False
class AccountsAdmin(admin.ModelAdmin):
form = TagsForm
list_display = ('id', 'name', 'type', 'phone', 'address1', 'address2', 'city', 'state', 'zip', 'status')
list_display_links = ('id', 'name', 'type', 'phone', 'address1', 'address2', 'city', 'state', 'zip', 'status')
list_filter = ('type', 'city', 'state', 'status')
search_fields = ['id', 'name', 'phone', 'address1']
inlines = (AccountsServices, AccountsNotes,)
fieldsets = [
(None, {
'classes': ('suit-tab suit-tab-general',),
'fields': ['name', 'phone', 'type', 'status', 'tags',]
}),
('Billing Address:', {
'classes': ('suit-tab suit-tab-general',),
'fields': ['address1', 'address2', 'city', 'state', 'zip', 'url',]
}),
('Billing Info:', {
'classes': ('suit-tab suit-tab-general',),
'fields': ['parent_flag', 'parent_account','billid',]
}),
(None, {
'classes': ('suit-tab suit-tab-inventory',),
'fields': []
}),
(None, {
'classes': ('suit-tab suit-tab-services',),
'fields': []
}),
]
suit_form_tabs = (('general', 'General'), ('network', 'Network'), ('services', 'Services'),)
Currently you get a 500 error when changing a reversioned item.
There's a JS syntax error in select2.min.js.
Btw, it seems like some of the JS files are included twice.
Impossible integration of django-filer==1.1.1 only display in menu a option of Filer > Folders and when click modify folder says:
TemplateSyntaxError at /admin/filer/folder/
'filermedia' is not a valid tag library: Template library filermedia not found, tried django.templatetags.filermedia,suit.templatetags.filermedia,django.contrib.admin.templatetags.filermedia,django.contrib.staticfiles.templatetags.filermedia,django_assets.templatetags.filermedia,django_activeurl.templatetags.filermedia,main.templatetags.filermedia,import_export.templatetags.filermedia,cookielaw.templatetags.filermedia,easy_thumbnails.templatetags.filermedia,filer.templatetags.filermedia,mptt.templatetags.filermedia
Python 2.7.6
Django==1.6.2
Pillow==2.3.0
django-filer==1.1.1
django_mptt==0.7
django-polymorphic==0.8.1
easy-thumbnails==2.3
Thisβs example is too simple,can you upload whole example.I mean it --- http://djangosuit.com/admin/
Hey, nice examples but can you add the custom views templates and how to make this, thanks for all π
I want to use Sourcegraph for django-suit-examples code search, browsing, and usage examples. Can an admin enable Sourcegraph for this repository? Just go to https://sourcegraph.com/github.com/darklow/django-suit-examples. (It should only take 30 seconds.)
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.