示例#1
0
    # Seed with sample data
    with app.test_request_context():
        if models.JobType.query.count() == 0:
            print >> sys.stderr, "Adding some job types"
            db.session.add(models.JobType(seq=10, name=u'fulltime', title=u'Full-time employment'))
            db.session.add(models.JobType(seq=20, name=u'contract', title=u'Short-term contract'))
            db.session.add(models.JobType(seq=30, name=u'freelance', title=u'Freelance or consulting'))
            db.session.add(models.JobType(seq=40, name=u'volunteer', title=u'Volunteer contributor'))
            db.session.add(models.JobType(seq=50, name=u'partner', title=u'Partner for a venture'))
            db.session.commit()
        if models.JobCategory.query.count() == 0:
            print >> sys.stderr, "Adding some job categories"
            db.session.add(models.JobCategory(seq=10, name=u'programming', title=u'Programming'))
            db.session.add(models.JobCategory(seq=20, name=u'ux', title=u'Interaction Design'))
            db.session.add(models.JobCategory(seq=30, name=u'design', title=u'Graphic Design'))
            db.session.add(models.JobCategory(seq=40, name=u'testing', title=u'Testing'))
            db.session.add(models.JobCategory(seq=50, name=u'sysadmin', title=u'Systems Administration'))
            db.session.add(models.JobCategory(seq=60, name=u'business', title=u'Business/Management'))
            db.session.add(models.JobCategory(seq=70, name=u'edit', title=u'Writer/Editor'))
            db.session.add(models.JobCategory(seq=80, name=u'support', title=u'Customer Support'))
            db.session.add(models.JobCategory(seq=90, name=u'mobile', title=u'Mobile (iPhone, Android, other)'))
            db.session.commit()
        if models.ReportCode.query.count() == 0:
            print >> sys.stderr, "Adding some report codes"
            db.session.add(models.ReportCode(seq=10, name=u'spam', title=u'Spam, not a job listing'))
            db.session.add(models.ReportCode(seq=20, name=u'fake', title=u'Appears to be a fake listing'))
            db.session.add(models.ReportCode(seq=30, name=u'anon', title=u'Organization is not clearly identified'))
            db.session.add(models.ReportCode(seq=40, name=u'unclear', title=u'Job position is not properly described'))
            db.session.commit()
    app.run('0.0.0.0', debug=True)
示例#2
0
                models.JobCategory(seq=80,
                                   name=u'support',
                                   title=u'Customer Support'))
            db.session.add(
                models.JobCategory(seq=90,
                                   name=u'mobile',
                                   title=u'Mobile (iPhone, Android, other)'))
            db.session.commit()
        if models.ReportCode.query.count() == 0:
            print >> sys.stderr, "Adding some report codes"
            db.session.add(
                models.ReportCode(seq=10,
                                  name=u'spam',
                                  title=u'Spam, not a job listing'))
            db.session.add(
                models.ReportCode(seq=20,
                                  name=u'fake',
                                  title=u'Appears to be a fake listing'))
            db.session.add(
                models.ReportCode(
                    seq=30,
                    name=u'anon',
                    title=u'Organization is not clearly identified'))
            db.session.add(
                models.ReportCode(
                    seq=40,
                    name=u'unclear',
                    title=u'Job position is not properly described'))
            db.session.commit()
    app.run('0.0.0.0', debug=True)
示例#3
0
    # Seed with sample data
    with app.test_request_context():
        if models.JobType.query.count() == 0:
            print >> sys.stderr, "Adding some job types"
            db.session.add(models.JobType(seq=10, slug='fulltime', title=u'Full-time employment'))
            db.session.add(models.JobType(seq=20, slug='contract', title=u'Short-term contract'))
            db.session.add(models.JobType(seq=30, slug='freelance', title=u'Freelance or consulting'))
            db.session.add(models.JobType(seq=40, slug='volunteer', title=u'Volunteer contributor'))
            db.session.add(models.JobType(seq=50, slug='partner', title=u'Partner for a venture'))
            db.session.commit()
        if models.JobCategory.query.count() == 0:
            print >> sys.stderr, "Adding some job categories"
            db.session.add(models.JobCategory(seq=10, slug='programming', title=u'Programming'))
            db.session.add(models.JobCategory(seq=20, slug='ux', title=u'Interaction Design'))
            db.session.add(models.JobCategory(seq=30, slug='design', title=u'Graphic Design'))
            db.session.add(models.JobCategory(seq=40, slug='testing', title=u'Testing'))
            db.session.add(models.JobCategory(seq=50, slug='sysadmin', title=u'Systems Administration'))
            db.session.add(models.JobCategory(seq=60, slug='business', title=u'Business/Management'))
            db.session.add(models.JobCategory(seq=70, slug='edit', title=u'Writer/Editor'))
            db.session.add(models.JobCategory(seq=80, slug='support', title=u'Customer Support'))
            db.session.add(models.JobCategory(seq=90, slug='mobile', title=u'Mobile (iPhone, Android, other)'))
            db.session.commit()
        if models.ReportCode.query.count() == 0:
            print >> sys.stderr, "Adding some report codes"
            db.session.add(models.ReportCode(seq=10, slug='spam', title=u'Spam, not a job listing'))
            db.session.add(models.ReportCode(seq=20, slug='fake', title=u'Appears to be a fake listing'))
            db.session.add(models.ReportCode(seq=30, slug='anon', title=u'Organization is not clearly identified'))
            db.session.add(models.ReportCode(seq=40, slug='unclear', title=u'Job position is not properly described'))
            db.session.commit()
    app.run(debug=True)
示例#4
0
#!/usr/bin/env python

import sys

from hasjob import app

try:
    port = int(sys.argv[1])
except (IndexError, ValueError):
    port = 5000
app.run('0.0.0.0', port=port)
示例#5
0
                models.JobCategory(seq=80,
                                   name=u'support',
                                   title=u'Customer Support'))
            db.session.add(
                models.JobCategory(seq=90,
                                   name=u'mobile',
                                   title=u'Mobile (iPhone, Android, other)'))
            db.session.commit()
        if models.ReportCode.query.count() == 0:
            print >> sys.stderr, "Adding some report codes"
            db.session.add(
                models.ReportCode(seq=10,
                                  name=u'spam',
                                  title=u'Spam, not a job listing'))
            db.session.add(
                models.ReportCode(seq=20,
                                  name=u'fake',
                                  title=u'Appears to be a fake listing'))
            db.session.add(
                models.ReportCode(
                    seq=30,
                    name=u'anon',
                    title=u'Organization is not clearly identified'))
            db.session.add(
                models.ReportCode(
                    seq=40,
                    name=u'unclear',
                    title=u'Job position is not properly described'))
            db.session.commit()
    app.run(debug=True)
示例#6
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from hasjob import app

try:
    port = int(sys.argv[1])
except (IndexError, ValueError):
    port = 5000
app.run('0.0.0.0', port=port)
示例#7
0
                models.JobCategory(seq=80,
                                   name=u'support',
                                   title=u'Customer Support'))
            db.session.add(
                models.JobCategory(seq=90,
                                   name=u'mobile',
                                   title=u'Mobile (iPhone, Android, other)'))
            db.session.commit()
        if not models.ReportCode.query.notempty():
            print >> sys.stderr, "Adding some report codes"
            db.session.add(
                models.ReportCode(seq=10,
                                  name=u'spam',
                                  title=u'Spam, not a job listing'))
            db.session.add(
                models.ReportCode(seq=20,
                                  name=u'fake',
                                  title=u'Appears to be a fake listing'))
            db.session.add(
                models.ReportCode(
                    seq=30,
                    name=u'anon',
                    title=u'Organization is not clearly identified'))
            db.session.add(
                models.ReportCode(
                    seq=40,
                    name=u'unclear',
                    title=u'Job position is not properly described'))
            db.session.commit()
    app.run('0.0.0.0', debug=True, port=5000)