Skip to content

Commit

Permalink
test data added to employes example app
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar committed Mar 19, 2015
1 parent d499e0c commit f1cdd2c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions examples/employees/README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
Employees
---------
Quick How to Example
--------------------

Simple example that uses relationships and security view customization.
Simple contacts application.

Create an Admin user::

$ fabmanager create-admin

Insert test data::

$ python testdata.py

Run it::

$ fabmanager run
Expand Down
4 changes: 2 additions & 2 deletions examples/employees/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class Employee(Model):
function = relationship("Function")
benefits = relationship('Benefit', secondary=assoc_benefits_employee, backref='employee')

begin_date = Column(Date, default=today, nullable=False)
end_date = Column(Date, nullable=True)
begin_date = Column(Date, default=datetime.date.today(), nullable=True)
end_date = Column(Date, default=datetime.date.today(), nullable=True)

def __repr__(self):
return self.full_name
2 changes: 1 addition & 1 deletion examples/employees/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class EmployeeHistoryView(ModelView):
class EmployeeView(ModelView):
datamodel = SQLAInterface(Employee)

list_columns = ['full_name', 'department', 'employee_number']
list_columns = ['full_name', 'department.name', 'employee_number']
edit_form_extra_fields = {'department': QuerySelectField('Department',
query_factory=department_query,
widget=Select2Widget(extra_classes="readonly"))}
Expand Down
Binary file modified examples/employees/config.pyc
Binary file not shown.

0 comments on commit f1cdd2c

Please sign in to comment.