Commits

Udi Bauman committed 1d9234b

added initial employee home

Comments (0)

Files changed (12)

django_ultrasound/customers/fixtures/initial_data.json

-[
-    {
-        "pk": 4, 
-        "model": "customers.htmlpage", 
-        "fields": {
-            "content": "\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", 
-            "title": "\u05d3\u05e3 \u05de\u05d1\u05e7\u05e9 \u05de\u05d5\u05e2\u05de\u05d3\u05d5\u05ea"
-        }
-    }, 
-    {
-        "pk": 8, 
-        "model": "customers.htmlpage", 
-        "fields": {
-            "content": "\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05de\u05d5\u05e2\u05de\u05d3 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", 
-            "title": "\u05d3\u05e3 \u05de\u05d5\u05e2\u05de\u05d3"
-        }
-    }, 
-    {
-        "pk": 12, 
-        "model": "customers.htmlpage", 
-        "fields": {
-            "content": "\u05ea\u05d5\u05d3\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05e4\u05e8\u05d8\u05d9\u05dd \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", 
-            "title": "\u05d3\u05e3 \u05de\u05d5\u05e2\u05de\u05d3 \u05e2\u05dd \u05e4\u05e8\u05d8\u05d9\u05dd"
-        }
-    }, 
-    {
-        "pk": 16, 
-        "model": "customers.htmlpage", 
-        "fields": {
-            "content": "\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05dc\u05e7\u05d5\u05d7 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", 
-            "title": "\u05d3\u05e3 \u05dc\u05e7\u05d5\u05d7"
-        }
-    }, 
-    {
-        "pk": 20, 
-        "model": "customers.htmlpage", 
-        "fields": {
-            "content": "\u05d1\u05dc \u05d1\u05dc \u05d1\u05dc\u05d4\n\u05dc\u05e7\u05d5\u05d7 \u05de\u05d9\u05d5\u05d7\u05e1\n\u05d1\u05dc \u05d1\u05dc\u05d4", 
-            "title": "\u05d3\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05de\u05d9\u05d5\u05d7\u05e1"
-        }
-    }, 
-    {
-        "pk": 24, 
-        "model": "customers.htmlpage", 
-        "fields": {
-            "content": "\u05d1\u05dc \u05d4\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05e2\u05d3 \u05dc\u05d1\u05d9\u05e8\u05d5\u05e8 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", 
-            "title": "\u05d3\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05de\u05d5\u05e9\u05d4\u05d4 \u05d6\u05de\u05e0\u05d9\u05ea"
-        }
-    }, 
-    {
-        "pk": 28, 
-        "model": "customers.htmlpage", 
-        "fields": {
-            "content": "\u05dc\u05e6\u05e2\u05e8\u05e0\u05d5 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05de\u05d5\u05e9\u05d4\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", 
-            "title": "\u05d3\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05de\u05d5\u05e9\u05d4\u05d4"
-        }
-    }, 
-    {
-        "pk": 6, 
-        "model": "customers.customerstatus", 
-        "fields": {
-            "color": "silver", 
-            "code": 1, 
-            "name": "\u05de\u05d1\u05e7\u05e9 \u05de\u05d5\u05e2\u05de\u05d3\u05d5\u05ea", 
-            "html_page": 4
-        }
-    }, 
-    {
-        "pk": 10, 
-        "model": "customers.customerstatus", 
-        "fields": {
-            "color": "grey", 
-            "code": 2, 
-            "name": "\u05de\u05d5\u05e2\u05de\u05d3", 
-            "html_page": 8
-        }
-    }, 
-    {
-        "pk": 14, 
-        "model": "customers.customerstatus", 
-        "fields": {
-            "color": "cyan", 
-            "code": 3, 
-            "name": "\u05de\u05d5\u05e2\u05de\u05d3 \u05d0\u05e9\u05e8 \u05de\u05d9\u05dc\u05d0 \u05e4\u05e8\u05d8\u05d9\u05dd", 
-            "html_page": 12
-        }
-    }, 
-    {
-        "pk": 18, 
-        "model": "customers.customerstatus", 
-        "fields": {
-            "color": "green", 
-            "code": 4, 
-            "name": "\u05dc\u05e7\u05d5\u05d7", 
-            "html_page": 16
-        }
-    }, 
-    {
-        "pk": 22, 
-        "model": "customers.customerstatus", 
-        "fields": {
-            "color": "blue", 
-            "code": 5, 
-            "name": "\u05dc\u05e7\u05d5\u05d7 \u05de\u05d9\u05d5\u05d7\u05e1", 
-            "html_page": 20
-        }
-    }, 
-    {
-        "pk": 26, 
-        "model": "customers.customerstatus", 
-        "fields": {
-            "color": "orange", 
-            "code": 6, 
-            "name": "\u05de\u05d5\u05e9\u05d4\u05d4 \u05d6\u05de\u05e0\u05d9\u05ea", 
-            "html_page": 24
-        }
-    }, 
-    {
-        "pk": 30, 
-        "model": "customers.customerstatus", 
-        "fields": {
-            "color": "red", 
-            "code": 7, 
-            "name": "\u05de\u05d5\u05e9\u05d4\u05d4", 
-            "html_page": 28
-        }
-    }, 
-    {
-        "pk": 33, 
-        "model": "customers.customer", 
-        "fields": {
-            "update_data": false, 
-            "id_number": 22222, 
-            "photo": "", 
-            "customer_status": 6, 
-            "sex": 1, 
-            "link_to_page": "", 
-            "user": 1, 
-            "address": null, 
-            "birth_day": "1978-01-05", 
-            "fb_key": "11111", 
-            "check_data": false, 
-            "education_institute": null
-        }
-    }
-]
+[{"pk": 4, "model": "customers.htmlpage", "fields": {"content": "\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", "title": "\u05d3\u05e3 \u05de\u05d1\u05e7\u05e9 \u05de\u05d5\u05e2\u05de\u05d3\u05d5\u05ea"}}, {"pk": 8, "model": "customers.htmlpage", "fields": {"content": "\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05de\u05d5\u05e2\u05de\u05d3 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", "title": "\u05d3\u05e3 \u05de\u05d5\u05e2\u05de\u05d3"}}, {"pk": 12, "model": "customers.htmlpage", "fields": {"content": "\u05ea\u05d5\u05d3\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05e4\u05e8\u05d8\u05d9\u05dd \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", "title": "\u05d3\u05e3 \u05de\u05d5\u05e2\u05de\u05d3 \u05e2\u05dd \u05e4\u05e8\u05d8\u05d9\u05dd"}}, {"pk": 16, "model": "customers.htmlpage", "fields": {"content": "\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05dc\u05e7\u05d5\u05d7 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", "title": "\u05d3\u05e3 \u05dc\u05e7\u05d5\u05d7"}}, {"pk": 20, "model": "customers.htmlpage", "fields": {"content": "\u05d1\u05dc \u05d1\u05dc \u05d1\u05dc\u05d4\n\u05dc\u05e7\u05d5\u05d7 \u05de\u05d9\u05d5\u05d7\u05e1\n\u05d1\u05dc \u05d1\u05dc\u05d4", "title": "\u05d3\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05de\u05d9\u05d5\u05d7\u05e1"}}, {"pk": 24, "model": "customers.htmlpage", "fields": {"content": "\u05d1\u05dc \u05d4\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05e2\u05d3 \u05dc\u05d1\u05d9\u05e8\u05d5\u05e8 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", "title": "\u05d3\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05de\u05d5\u05e9\u05d4\u05d4 \u05d6\u05de\u05e0\u05d9\u05ea"}}, {"pk": 28, "model": "customers.htmlpage", "fields": {"content": "\u05dc\u05e6\u05e2\u05e8\u05e0\u05d5 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05de\u05d5\u05e9\u05d4\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", "title": "\u05d3\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05de\u05d5\u05e9\u05d4\u05d4"}}, {"pk": 6, "model": "customers.customerstatus", "fields": {"color": "silver", "code": 1, "name": "\u05de\u05d1\u05e7\u05e9 \u05de\u05d5\u05e2\u05de\u05d3\u05d5\u05ea", "html_page": 4}}, {"pk": 10, "model": "customers.customerstatus", "fields": {"color": "grey", "code": 2, "name": "\u05de\u05d5\u05e2\u05de\u05d3", "html_page": 8}}, {"pk": 14, "model": "customers.customerstatus", "fields": {"color": "cyan", "code": 3, "name": "\u05de\u05d5\u05e2\u05de\u05d3 \u05d0\u05e9\u05e8 \u05de\u05d9\u05dc\u05d0 \u05e4\u05e8\u05d8\u05d9\u05dd", "html_page": 12}}, {"pk": 18, "model": "customers.customerstatus", "fields": {"color": "green", "code": 4, "name": "\u05dc\u05e7\u05d5\u05d7", "html_page": 16}}, {"pk": 22, "model": "customers.customerstatus", "fields": {"color": "blue", "code": 5, "name": "\u05dc\u05e7\u05d5\u05d7 \u05de\u05d9\u05d5\u05d7\u05e1", "html_page": 20}}, {"pk": 26, "model": "customers.customerstatus", "fields": {"color": "orange", "code": 6, "name": "\u05de\u05d5\u05e9\u05d4\u05d4 \u05d6\u05de\u05e0\u05d9\u05ea", "html_page": 24}}, {"pk": 30, "model": "customers.customerstatus", "fields": {"color": "red", "code": 7, "name": "\u05de\u05d5\u05e9\u05d4\u05d4", "html_page": 28}}, {"pk": 33, "model": "customers.customer", "fields": {"update_data": false, "id_number": 22222, "photo": "", "customer_status": 6, "sex": 1, "link_to_page": "", "user": 1, "address": null, "birth_day": "1978-01-05", "fb_key": "11111", "check_data": false, "education_institute": null}}]

django_ultrasound/customers/views.py

+from django.http import HttpResponseRedirect
 from django.contrib.auth.decorators import login_required
 from django.shortcuts import render_to_response
 from customers.forms import CustomerMoreDetailsForm
 from customers.models import CANDIDATE
 from common.utils import evaluate_template
+from employees.models import Employee
 
 @login_required
 def customer_home(request):
     user = request.user
+
+    if is_employee(user):
+        return HttpResponseRedirect("/employee_home/")
+
     customer = user.customer.get()
     customer_status = customer.customer_status
     data = {
     data.update({
         "more_details_form": CustomerMoreDetailsForm()
     })
-    return data
+    return data
+
+
+
+def is_employee(user):
+    return Employee.objects.filter(user=user).count() > 0

django_ultrasound/employees/fixtures/auth.json

+[
+    {
+        "pk": 1,
+        "model": "auth.user",
+        "fields": {
+            "username": "admin",
+            "first_name": "",
+            "last_name": "",
+            "is_active": true,
+            "is_superuser": true,
+            "is_staff": true,
+            "last_login": "2011-01-05 10:01:19",
+            "password": "sha1$49bfc$49236facb2436f8095ca63e0ecbcf20c507c6df0",
+            "email": "rami.zlingher@gmail.com",
+            "date_joined": "2011-01-05 10:01:15"
+        }
+    }
+]

django_ultrasound/employees/fixtures/initial_data.json

-[
-    {
-        "pk": 54, 
-        "model": "employees.employeetype", 
-        "fields": {
-            "name": "\u05d9\u05d7\u05e6\u05df"
-        }
-    }, 
-    {
-        "pk": 56, 
-        "model": "employees.employee", 
-        "fields": {
-            "id_number": 1111, 
-            "last_update": "2011-01-05 10:08:33", 
-            "user": 1, 
-            "fb_key": "2222", 
-            "boss": null, 
-            "employee_type": 54
-        }
-    }, 
-    {
-        "pk": 34, 
-        "model": "employees.activity", 
-        "fields": {
-            "customer": 33, 
-            "date_of_activity": "2011-01-05 10:05:41", 
-            "activity": 1, 
-            "employee": 1, 
-            "old_customer_status": null, 
-            "new_customer_status": 6
-        }
-    }
-]
+[{"pk": 54, "model": "employees.employeetype", "fields": {"code": 40, "name": "\u05d9\u05d7\u05e6\u05df"}}, {"pk": 106, "model": "employees.employeetype", "fields": {"code": 20, "name": "\u05de\u05e0\u05d4\u05dc \u05db\u05d5\u05d7 \u05d0\u05d3\u05dd"}}, {"pk": 108, "model": "employees.employeetype", "fields": {"code": 10, "name": "\u05de\u05e0\u05d4\u05dc \u05de\u05d5\u05e2\u05d3\u05d5\u05df"}}, {"pk": 56, "model": "employees.employee", "fields": {"id_number": 1111, "last_update": "2011-01-05 10:08:33", "user": 1, "fb_key": "2222", "boss": null, "employee_type": 54}}, {"pk": 114, "model": "employees.employee", "fields": {"id_number": 91827364, "last_update": "2011-01-06 07:59:43", "user": 112, "fb_key": "100001632266992", "boss": null, "employee_type": 108}}, {"pk": 116, "model": "employees.employee", "fields": {"id_number": 123456789, "last_update": "2011-01-06 07:59:48", "user": 110, "fb_key": "100001761357244", "boss": 114, "employee_type": 106}}, {"pk": 122, "model": "employees.employee", "fields": {"id_number": 25669714, "last_update": "2011-01-06 08:32:02", "user": 120, "fb_key": "502772797", "boss": 114, "employee_type": 54}}, {"pk": 34, "model": "employees.activity", "fields": {"customer": 33, "date_of_activity": "2011-01-05 10:05:41", "activity": 1, "employee": 1, "old_customer_status": null, "new_customer_status": 6}}]

django_ultrasound/employees/models.py

 from common.current_user.models import CurrentUserField
 
 
+CLUB_MANAGER = 10
+MAN_POWER = 20
+EVENT_MANAGER = 30
+SALES_MAN = 40
+RECEPTIONIST = 50
+BARMAN_MANAGER = 60
+
+
+
 class EmployeeType(models.Model):
     name = models.CharField(_("name"), max_length=100)
+    code = models.IntegerField(
+            help_text="CLUB_MANAGER = 10 | MAN_POWER = 20 | EVENT_MANAGER = 30 | SALES_MAN = 40 | RECEPTIONIST = 50 | BARMAN_MANAGER = 60")
 
     def __unicode__(self):
         return self.name

django_ultrasound/employees/templates/employee_home.html

+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />{% endblock %}
+
+{% block coltype %}colMS{% endblock %}
+
+{% block bodyclass %}dashboard{% endblock %}
+
+{% block breadcrumbs %}{% endblock %}
+
+{% block content %}
+<div id="content-main">
+
+{% if app_list %}
+    {% for app in app_list %}
+        <div class="module">
+        <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
+        <caption>{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</caption>
+        {% for model in app.models %}
+            <tr>
+                <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
+
+                {% if model.perms_add %}
+                    <td><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Add' %}</a></td>
+                {% else %}
+                    <td>&nbsp;</td>
+                {% endif %}
+
+                {% if model.perms_change %}
+                    <td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td>
+                {% else %}
+                    <td>&nbsp;</td>
+                {% endif %}
+            </tr>
+        {% endfor %}
+        </table>
+        </div>
+    {% endfor %}
+{% else %}
+    <p>{% trans "You don't have permission to edit anything." %}</p>
+{% endif %}
+</div>
+{% endblock %}
+
+{% block sidebar %}
+<div id="content-related">
+    <div class="module" id="recent-actions-module">
+        <h2>{% trans 'Recent Actions' %}</h2>
+        <h3>{% trans 'My Actions' %}</h3>
+            {% load log %}
+            {% get_admin_log 10 as admin_log for_user user %}
+            {% if not admin_log %}
+            <p>{% trans 'None available' %}</p>
+            {% else %}
+            <ul class="actionlist">
+            {% for entry in admin_log %}
+            <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
+                {% if entry.is_deletion %}
+                    {{ entry.object_repr }}
+                {% else %}
+                    <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
+                {% endif %}
+                <br/>
+                {% if entry.content_type %}
+                    <span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
+                {% else %}
+                    <span class="mini quiet">{% trans 'Unknown content' %}</span>
+                {% endif %}
+            </li>
+            {% endfor %}
+            </ul>
+            {% endif %}
+    </div>
+</div>
+{% endblock %}

django_ultrasound/employees/views.py

-from django.contrib.auth.models import User
+from django.shortcuts import render_to_response
 from django.http import HttpResponse
 from django.contrib.auth.decorators import login_required
+from employees.models import *
+from django.utils.translation import ugettext as _
+
+
+
+
+
+
+
+@login_required
+def employee_home(request):
+
+    user = request.user
+    
+    employee = Employee.objects.get(user=request.user)
+    if employee.employee_type.code == CLUB_MANAGER:
+        app_list = [
+                { "name": _("activities"),
+                  "app_url": "",
+                  "models": [
+                              {"name": _("Events"), "admin_url": "/admin/events/event/", "perms_add": True, "perms_change": True},
+                            ]
+                },
+
+                { "name": _("reports"),
+                  "app_url": "",
+                  "models": [
+                              {"name": _("Some report"), "admin_url": "/reports/some_report/",},
+                            ]
+                },
+
+                { "name": _("administration"),
+                  "app_url": "",
+                  "models": [
+                              {"name": _("Products"), "admin_url": "/admin/products/product/", "perms_add": True, "perms_change": True},
+                            ]
+                },
+        ]
+
+    elif employee.employee_type.code == MAN_POWER:
+        app_list = [
+                { "name": _("activities"),
+                  "app_url": "",
+                  "models": [
+                              {"name": _("Employees"), "admin_url": "/admin/employees/employee/", "perms_add": True, "perms_change": True},
+                            ]
+                },
+                { "name": _("reports"),
+                  "app_url": "",
+                  "models": [
+                              {"name": _("Man power report"), "admin_url": "/reports/man_power_report/",},
+                            ]
+                },
+        ]
+
+    else:
+        pass
+
+    return render_to_response("employee_home.html", locals())
+
+
 
 def setup_first_user(request):
     if User.objects.filter(username="admin").count() == 0:
         user = User()
         user.username = "admin"
         user.set_password("admin")
-        user.email = "rami.zlingher@gmail.com"
+        user.email = "rami.zelingher@gmail.com"
         user.is_staff = True
         user.is_superuser = True
         user.save()

django_ultrasound/events/fixtures/initial_data.json

-[
-    {
-        "pk": 47, 
-        "model": "events.htmlpage", 
-        "fields": {
-            "content": "\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05e9\u05d9\u05e9\u05d9 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05e9\u05e0\u05ea 2011 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", 
-            "title": "\u05de\u05e1\u05d9\u05d1\u05ea \u05e9\u05d9\u05e9\u05d9 \u05ea\u05d7\u05d9\u05dc\u05ea \u05d4\u05e9\u05e0\u05d4"
-        }
-    }, 
-    {
-        "pk": 41, 
-        "model": "events.location", 
-        "fields": {
-            "locationName": "\u05d0\u05d5\u05dc\u05d8\u05e8\u05d4\u05e1\u05d0\u05d5\u05e0\u05d3"
-        }
-    }, 
-    {
-        "pk": 44, 
-        "model": "events.eventtype", 
-        "fields": {
-            "discriptionsType": "\u05de\u05e1\u05d9\u05d1\u05d5\u05ea \u05d9\u05d5\u05dd \u05e9\u05d9\u05e9\u05d9"
-        }
-    }, 
-    {
-        "pk": 38, 
-        "model": "events.constraint", 
-        "fields": {
-            "constraint_code": "customer.age >= 20 and customer.age <= 25", 
-            "description": "\u05d2\u05d9\u05dc\u05d0\u05d9 20-25"
-        }
-    }, 
-    {
-        "pk": 58, 
-        "model": "events.event", 
-        "fields": {
-            "end_houre": "2011-01-05 10:08:38", 
-            "html_page": 47, 
-            "description": "\u05de\u05e1\u05d9\u05d1\u05ea \u05e9\u05d9\u05e9\u05d9 \u05ea\u05d7\u05d9\u05dc\u05ea \u05d4\u05e9\u05e0\u05d4", 
-            "start_houre": "2011-01-05 10:08:38", 
-            "event_mounth": 1, 
-            "marketing_employee": null, 
-            "event_year": 2011, 
-            "event_day": 7, 
-            "logo": "http://www.waze.co.il/images/nav/logo.gif", 
-            "constrain": 38, 
-            "employee_in_charge": null, 
-            "type": 44, 
-            "location": 41
-        }
-    }, 
-    {
-        "pk": 59, 
-        "model": "events.allocation", 
-        "fields": {
-            "allocation_event": 58, 
-            "allocation_product": 50, 
-            "quantity_use": 0, 
-            "allocation_price": 25, 
-            "employee_get_allocation": 56, 
-            "quantity_allocation": 50
-        }
-    }
-]
+[{"pk": 47, "model": "events.htmlpage", "fields": {"content": "\u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05e9\u05d9\u05e9\u05d9 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4 \u05e9\u05e0\u05ea 2011 \u05d1\u05dc\u05d4 \u05d1\u05dc\u05d4", "title": "\u05de\u05e1\u05d9\u05d1\u05ea \u05e9\u05d9\u05e9\u05d9 \u05ea\u05d7\u05d9\u05dc\u05ea \u05d4\u05e9\u05e0\u05d4"}}, {"pk": 41, "model": "events.location", "fields": {"locationName": "\u05d0\u05d5\u05dc\u05d8\u05e8\u05d4\u05e1\u05d0\u05d5\u05e0\u05d3"}}, {"pk": 44, "model": "events.eventtype", "fields": {"discriptionsType": "\u05de\u05e1\u05d9\u05d1\u05d5\u05ea \u05d9\u05d5\u05dd \u05e9\u05d9\u05e9\u05d9"}}, {"pk": 38, "model": "events.constraint", "fields": {"constraint_code": "customer.age >= 20 and customer.age <= 25", "description": "\u05d2\u05d9\u05dc\u05d0\u05d9 20-25"}}, {"pk": 58, "model": "events.event", "fields": {"end_houre": "2011-01-06 08:52:25", "html_page": 47, "description": "\u05de\u05e1\u05d9\u05d1\u05ea \u05e9\u05d9\u05e9\u05d9 \u05ea\u05d7\u05d9\u05dc\u05ea \u05d4\u05e9\u05e0\u05d4", "start_houre": "2011-01-06 08:52:25", "event_mounth": 1, "marketing_employee": null, "event_year": 2011, "event_day": 7, "logo": "http://www.waze.co.il/images/nav/logo.gif", "constrain": 38, "employee_in_charge": 122, "type": 44, "location": 41}}, {"pk": 59, "model": "events.allocation", "fields": {"allocation_event": 58, "allocation_product": 50, "quantity_use": 0, "allocation_price": 25, "employee_get_allocation": 56, "quantity_allocation": 50}}]

django_ultrasound/products/fixtures/initial_data.json

-[
-    {
-        "pk": 50, 
-        "model": "products.product", 
-        "fields": {
-            "supplier": null, 
-            "price": "30.00", 
-            "title": "\u05db\u05e8\u05d8\u05d9\u05e1 \u05db\u05e0\u05d9\u05e1\u05d4"
-        }
-    }
-]
+[{"pk": 50, "model": "products.product", "fields": {"supplier": null, "price": "30.00", "title": "\u05db\u05e8\u05d8\u05d9\u05e1 \u05db\u05e0\u05d9\u05e1\u05d4"}}]

django_ultrasound/templates/admin/change_form.html

+{% extends "admin/base_site.html" %}
+{% load i18n admin_modify adminmedia %}
+
+{% block extrahead %}{{ block.super }}
+{% url admin:jsi18n as jsi18nurl %}
+<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
+{{ media }}
+{% endblock %}
+
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
+
+{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}
+
+{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
+
+{% block breadcrumbs %}{% if not is_popup %}
+<div class="breadcrumbs">
+     <a href="/employee_home/">{% trans "Home" %}</a> &rsaquo;
+     <a href="../../">{{ app_label|capfirst|escape }}</a> &rsaquo;
+     {% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} &rsaquo;
+     {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
+</div>
+{% endif %}{% endblock %}
+
+{% block content %}<div id="content-main">
+{% block object-tools %}
+{% if change %}{% if not is_popup %}
+  <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li>
+  {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
+  </ul>
+{% endif %}{% endif %}
+{% endblock %}
+<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
+<div>
+{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
+{% if save_on_top %}{% submit_row %}{% endif %}
+{% if errors %}
+    <p class="errornote">
+    {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
+    </p>
+    {{ adminform.form.non_field_errors }}
+{% endif %}
+
+{% for fieldset in adminform %}
+  {% include "admin/includes/fieldset.html" %}
+{% endfor %}
+
+{% block after_field_sets %}{% endblock %}
+
+{% for inline_admin_formset in inline_admin_formsets %}
+    {% include inline_admin_formset.opts.template %}
+{% endfor %}
+
+{% block after_related_objects %}{% endblock %}
+
+{% submit_row %}
+
+{% if adminform and add %}
+   <script type="text/javascript">document.getElementById("{{ adminform.first_field.auto_id }}").focus();</script>
+{% endif %}
+
+{# JavaScript for prepopulated fields #}
+{% prepopulated_fields_js %}
+
+</div>
+</form></div>
+{% endblock %}

django_ultrasound/templates/admin/change_list.html

+{% extends "admin/base_site.html" %}
+{% load adminmedia admin_list i18n %}
+
+{% block extrastyle %}
+  {{ block.super }}
+  <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
+  {% if cl.formset %}
+    <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />
+  {% endif %}
+  {% if cl.formset or action_form %}
+    {% url admin:jsi18n as jsi18nurl %}
+    <script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
+  {% endif %}
+  {{ media.css }}
+  {% if not actions_on_top and not actions_on_bottom %}
+    <style>
+      #changelist table thead th:first-child {width: inherit}
+    </style>
+  {% endif %}
+{% endblock %}
+
+{% block extrahead %}
+{{ block.super }}
+{{ media.js }}
+{% if action_form %}{% if actions_on_top or actions_on_bottom %}
+<script type="text/javascript">
+(function($) {
+    $(document).ready(function($) {
+        $("tr input.action-select").actions();
+    });
+})(django.jQuery);
+</script>
+{% endif %}{% endif %}
+{% endblock %}
+
+{% block bodyclass %}change-list{% endblock %}
+
+{% if not is_popup %}
+  {% block breadcrumbs %}
+    <div class="breadcrumbs">
+      <a href="/employee_home/">
+        {% trans "Home" %}
+      </a>
+       &rsaquo;
+       <a href="../">
+         {{ app_label|capfirst }}
+      </a>
+      &rsaquo;
+      {{ cl.opts.verbose_name_plural|capfirst }}
+    </div>
+  {% endblock %}
+{% endif %}
+
+{% block coltype %}flex{% endblock %}
+
+{% block content %}
+  <div id="content-main">
+    {% block object-tools %}
+      {% if has_add_permission %}
+        <ul class="object-tools">
+          <li>
+            <a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
+              {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
+            </a>
+          </li>
+        </ul>
+      {% endif %}
+    {% endblock %}
+    {% if cl.formset.errors %}
+        <p class="errornote">
+        {% blocktrans count cl.formset.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
+        </p>
+        {{ cl.formset.non_form_errors }}
+    {% endif %}
+    <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
+      {% block search %}{% search_form cl %}{% endblock %}
+      {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
+
+      {% block filters %}
+        {% if cl.has_filters %}
+          <div id="changelist-filter">
+            <h2>{% trans 'Filter' %}</h2>
+            {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
+          </div>
+        {% endif %}
+      {% endblock %}
+
+      <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
+      {% if cl.formset %}
+        {{ cl.formset.management_form }}
+      {% endif %}
+
+      {% block result_list %}
+          {% if action_form and actions_on_top and cl.full_result_count %}{% admin_actions %}{% endif %}
+          {% result_list cl %}
+          {% if action_form and actions_on_bottom and cl.full_result_count %}{% admin_actions %}{% endif %}
+      {% endblock %}
+      {% block pagination %}{% pagination cl %}{% endblock %}
+      </form>
+    </div>
+  </div>
+{% endblock %}

django_ultrasound/urls.py

     (r'^setup/create_first_user/', 'employees.views.setup_first_user'),
 
     (r'^home/', 'customers.views.customer_home'),
+    (r'^employee_home/', 'employees.views.employee_home'),
+
 
     url(r'^$', direct_to_template, {'template': 'login.html'}, name='login'),
 )