Coder Social home page Coder Social logo

jp74 / django-model-publisher Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 24.0 117 KB

Handy mixin/abstract class for providing a "publisher workflow" to arbitrary Django models.

License: BSD 3-Clause "New" or "Revised" License

Makefile 2.55% Python 85.81% CSS 1.22% JavaScript 0.89% HTML 9.53%

django-model-publisher's People

Contributors

bashu avatar cdobbyn avatar cptlemming avatar jssel avatar leejp74 avatar leesolway avatar mrmachine 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

Watchers

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

django-model-publisher's Issues

Missing languages tab (hvad) at django admin

My order at inherit's it's : PublisherAdmin, TranslatableAdmin
Whatever, when changing the order to : TranslatableAdmin, PublisherAdmin here are missing the buttons from publisher package

pip install doesn't work properly

jakubnowak@MBP-Jakub:website $ pip install django-model-publisher
Downloading/unpacking django-model-publisher
  Could not find any downloads that satisfy the requirement django-model-publisher
Cleaning up...
No distributions at all found for django-model-publisher
Storing debug log for failure in /var/folders/hl/gvnsh9c17rjc3tylvp079nq80000gn/T/tmpOnGDoU
/usr/local/bin/pip run on Mon Jan 12 19:13:35 2015
Downloading/unpacking django-model-publisher
  Getting page https://pypi.python.org/simple/django-model-publisher/
  URLs to search for versions for django-model-publisher:
  * https://pypi.python.org/simple/django-model-publisher/
  Analyzing links from page https://pypi.python.org/simple/django-model-publisher/
  Could not find any downloads that satisfy the requirement django-model-publisher
Cleaning up...
  Removing temporary dir /private/var/folders/hl/gvnsh9c17rjc3tylvp079nq80000gn/T/pip_build_jakubnowak...
No distributions at all found for django-model-publisher
Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1177, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/index.py", line 277, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for django-model-publisher

`django-model-utils` 2.4 removes `PassThroughManagerMixin`.

Django 1.7 has as_manager() now which does the same thing as PassThroughManager. For PassThroughManagerMixin, I think people can use PublisherManager.from_queryset(...)() instead.

Alternatively, you will need to pin to django-model-utils<2.4, which doesn't have Django 1.9 compatibility.

KeyError <Thread(Thread-1, started 139973582857984)>

It's happening everytime when i try assert or print some function at SomeClassAdmin.__init__()

ERROR Internal Server Error: /en/admin/news/news/18/
Traceback (most recent call last):
  File "/home/user/.virtualenvs/projects/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in get_response
    response = middleware_method(request, response)
  File "/home/user/.virtualenvs/projects/local/lib/python2.7/site-packages/publisher/middleware.py", line 18, in process_response
    del PublisherMiddleware._draft_status[current_thread()]
KeyError: <Thread(Thread-1, started 139973582857984)>

Getting django-model-publisher work nice with django parler

Hey there,
I'm trying to integrate django-model-publisher within a django 1.6.x app with django parler 1.0 (runs as a django-cms 3.x app). My Model looks something like this:

class Article(PublisherModel, TranslatableModel):

    translations = TranslatedFields(
        title = models.CharField(_('Title'),
            max_length=256
        ),
        content = HTMLField(_('Inhalt'),
            blank=True
        )
    )

    pub_date = models.DateTimeField(
        default = datetime.datetime.now,
        blank=False)

while my admin looks like this:

class NewsAdmin(TranslatableAdmin, PublisherAdmin):
    list_display = ['title']


admin.site.register(Article, NewsAdmin)

When I try to save a model, it throws an error about the QuerySet....

Exception Type: ImproperlyConfigured at /de/admin/news/article/
Exception Value: PublisherQuerySet class does not inherit from TranslatableQuerySet

... and since I'm pretty new to django I don't really have a clue whats going on :)

Am I doing something completely wrong here? Could someone please point me in the right direction on how to integrate the model-publisher together with django-parler ?

Thanks
Steffen

django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/apps/config.py", line 112, in create
    mod = import_module(mod_path)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/bashu/Projects/django-sigma-cms-demo/djangoapp/sigmacms/apps.py", line 8, in <module>
    from fluent_pages.extensions import page_type_pool
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/src/django-fluent-pages/fluent_pages/extensions/__init__.py", line 11, in <module>
    from .pagetypebase import PageTypePlugin
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/src/django-fluent-pages/fluent_pages/extensions/pagetypebase.py", line 18, in <module>
    from fluent_pages.adminui import PageAdmin
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/src/django-fluent-pages/fluent_pages/adminui/__init__.py", line 14, in <module>
    from .overrides import PageParentAdmin, PageChildAdmin, PageAdmin
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/src/django-fluent-pages/fluent_pages/adminui/overrides.py", line 11, in <module>
    PageParentAdmin = type("PageParentAdmin", (import_settings_class('FLUENT_PAGES_PARENT_ADMIN_MIXIN'), DefaultPageParentAdmin), {})
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/src/django-fluent-utils/fluent_utils/load.py", line 23, in import_settings_class
    return import_class(config_value, setting_name)
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/src/django-fluent-utils/fluent_utils/load.py", line 33, in import_class
    mod = _import_module(mod_name, classnames=(class_name,))
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/src/django-fluent-utils/fluent_utils/load.py", line 67, in _import_module
    return __import__(module_label, fromlist=classnames)
  File "/Users/bashu/Projects/django-sigma-cms-demo/djangoapp/sigmacms/integration/admin.py", line 9, in <module>
    from publisher.admin import PublisherAdmin as PublisherAdminBase
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/publisher/admin.py", line 19, in <module>
    make_published.short_description = _('Publish')
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 84, in ugettext
    return _trans.ugettext(message)
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 323, in ugettext
    return do_translate(message, 'ugettext')
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 300, in do_translate
    _default = _default or translation(settings.LANGUAGE_CODE)
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 206, in translation
    _translations[language] = DjangoTranslation(language)
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 116, in __init__
    self._add_installed_apps_translations()
  File "/Users/bashu/Projects/django-sigma-cms-demo/virtualenv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 164, in _add_installed_apps_translations
    "The translation infrastructure cannot be initialized before the "
django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.```

More abstract requirements in `setup.py`.

If django-model-publisher doesn't absolutely require version 2.0.3 of django-model-utils, the version spec should be removed or at least changed to >=2.0.3 instead of ==2.0.3. I'm trying to use model-django-publisher in a project that also uses django-model-utils and I'd like to be able to use a more recent version in my project, and this is causing version conflicts.

Likewise, is wheel==0.23.0 absolutely required, or is it even required at all? It might be needed when creating a package for PyPI, but probably isn't necessary to run the package when installed from PyPI?

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.