sainipray / djadmin Goto Github PK
View Code? Open in Web Editor NEWDjadmin is a django admin theme
License: MIT License
Djadmin is a django admin theme
License: MIT License
name = models.ForeignKey(AUTH_USER_MODEL, verbose_name=_('User'), null=True) TypeError: __init__() missing 1 required positional argument: 'on_delete'
i am getting this error
I think on the function get_file_detail must be checking file is None when class name ImageField or FileField.
If you can implement my code as below.
@register.simple_tag
def get_file_detail(adminform, field):
field_data = adminform.form.initial[field]
field_name = type(field_data).__name__
try:
if field_name == 'ImageFieldFile':
if not bool(field_data):
return {'type': 'image', 'width': 0, 'height': 0, 'url': '', 'size': 0, 'extension': ''}
filename, file_extension = os.path.splitext(field_data.url)
return {'type': 'image', 'width': field_data.width, 'height': field_data.height, 'url': field_data.url, 'size': field_data.size, 'extension': file_extension}
if field_name == 'FieldFile':
if not bool(field_data):
return {'type': 'file', 'url': '', 'size': 0, 'extension': ''}
filename, file_extension = os.path.splitext(field_data.url)
return {'type': 'file', 'url': field_data.url, 'size': field_data.size, 'extension': file_extension}
return field
except IOError:
pass
Thank You.
Hi ๐
This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.
Once you have closed this issue, I'll create seperate pull requests for every update as soon as I find one.
That's it for now!
Happy merging! ๐ค
If you get this error : invalid literal for int() with base 10: '1" class="action-select'
Solution :
add this function to : /usr/local/lib/python2.7/dist-packages/djadmin/templatetags/custom.py
@register.filter def get_value(result_checkbox_html): value = result_checkbox_html.split( ) for x in value: if x.startswith("value"): val = x.split("=") return val[1].replace('"','') return None
and go to this file : /usr/local/lib/python2.7/dist-packages/djadmin/templates/admin/change_list_results.html
replace this "admin_change_list_value" with "get_value"
Hi, I am using django 1.9 and I'm getting this error.
python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 21, in
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/core/management/init.py", line 377, in execute
django.setup()
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/djadmin/models.py", line 19, in
class Visitor(models.Model):
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/djadmin/models.py", line 23, in Visitor
name = models.ForeignKey(AUTH_USER_MODEL, verbose_name=('User'), null=True)
TypeError: init() missing 1 required positional argument: 'on_delete'
ERRORS:
djadmin.Visitor.name: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out.
HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.
It is not supporting in Django 2,I have fixed this issue on my local.
If possible add me as a contributor so that i can make those changes, Or
You need to fix few changes i am attaching a file for this fixes please update.
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.