Metadata-Version: 1.0
Name: django-widgets
Version: 0.1.0
Summary: A library to support writing reusable UI widgets for Django
Home-page: https://github.com/rakanalh/django-widgets
Author: Rakan Alhneiti
Author-email: rakan.alhneiti@gmail.com
License: LICENSE.txt
Description: django-widgets
        ==============
        
        A library to support creating reusable UI widgets for Django.
        
        Usage
        =====
        
        All you have to do is add 'django_widgets' to your INSTALLED_APPS. Django widgets will be looking for a module called 'widgets.py' in your root app directory. Make sure you add your widgets to that module.
        
        Then create your own widgets by subclassing UIWidget and TemplateWidget available under 'django_widgets.widgets'
        
        The example project contains the following samples. It creates two widgets:
        
        1. The first is a text widget which returns pure text
        2. The second one is a template based template which behaves similar to Class-based views in Django. You define your template name and django_widgets will take care of the rest.
        
        **index.html:**
        	
        	{% load widget %}
        	<html>
        		<body>
        			{% widget 'HelloWidget' cache="128" cache_prefix="hello_cached" %}
        
        			<br />
        
        			{% widget 'HelloTemplateWidget' word="Hello World" %}
        		</body>
        	</html>
        
        **template.html:**
        	
        	<html>
        		<body>
        			Hi this is a template widget, it says "{{ word }}" and it has given us the value of {{ some_var }}
        		</body>
        	</html>
        
        **and your widgets.py:**
        
        	from django_widgets.widgets import UIWidget, TemplateWidget
        
        
        	class HelloWidget(UIWidget):
        		def render(self, **kwargs):
        			return 'Hello world'
        
        
        	class HelloTemplateWidget(TemplateWidget):
        		template_name = 'template.html'
        
        		def get_context_data(self):
        			context = super(HelloTemplateWidget, self).get_context_data()
        
        			context['some_var'] = 123
        
        			return context
        
        Contributions
        =============
        
        This project is still a work in progress. I need to add a tests package as well as support for generics like Django does with models. If you like this project, you can contribute by submitting a pull request with modifications. All contributions are welcome and much appreciated.
Platform: UNKNOWN
