Git Product home page Git Product logo

djadmin's Introduction

Hello, folks ๐Ÿ‘‹

Hi, I'm Neeraj Kumar, Fullstack developer.

๐Ÿ”ง Technologies & Tools

Operating system

Language, Framework and Libraries

Repositories

Deployment and Web Services

๐Ÿ“Š GitHub Stats

djadmin's People

Contributors

sainipray 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

djadmin's Issues

its giving error

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

Error if ImageField or FileField is optional

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.

Initial Update

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! ๐Ÿค–

Delete row solution

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"

TypeError: __init__() missing 1 required positional argument: 'on_delete'

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'

Not supporting in Django 2

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.

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.