Exemplo n.º 1
0
    def create(self, request):
        attrs = self.flatten_dict(request.POST)
        try:
            name = attrs['name']
            slug = slugify(name)
            category = Category.objects.get(attrs['category'])
            
        except KeyError:
            return MANDATORY_PARAMETER_MISSING
        except Category.DoesNotExist:
            return MANDATORY_PARAMETER_MISSING
        
        url = attrs.get('url')
        pull_quote = attrs.get('pull_quote')
        short_description = attrs.get('short_description')
        description = attrs.get('description')
        start_date = attrs.get('start_date')
        end_date = attrs.get('end_date')
        user = request.user
#        skills = models.ManyToManyField('Skill')
        project = Project(name=name, slug=slug, category=category,
                            url="" if url is None else url,
                            pull_quote="" if pull_quote is None else pull_quote,
                            short_description="" if short_description is None else short_description,
                            description="" if description is None else description,
                            start_date= start_date,
                            end_date= end_date,
                            user=user)
        project.save()
        return project
Exemplo n.º 2
0
def projects(request, project_name):
    projectList = [
        Project(
            "2dDrafting", "2D Drafting application", "Developer",
            "Vb.Net, Eyeshot",
            "The lightweight library which provides AutoCAD OEM module with Eyeshot. Features like command line utility, drawing, Layer and editing features."
        ),
        Project(
            "3dDrafting", "3D Graphical User Interface", "Developer",
            "C#.Net, Eyeshot",
            "Provided WinForm based thread safe solution which provides better 3D view with more features like WinForm controller, custom entity, selection filter, etc."
        ),
        Project(
            "vanity", "Vanity", "Research And Developer", "C#.Net, ASP.NET",
            "Provided webform based solution that scan QR code and super imposed model infront of QR."
        ),
        Project(
            "custom_insole_designer", "Custom Insole Designer", "Developer",
            "C#.Net, Eyeshot",
            "Provided WinForm based solution to generate the insole for scanned human foot. Also provided trimming, solidify, alignment and Mesh deformation (mapped 2D curvature to 3D surface). Generated machine code of insole for CNC machine."
        ),
        Project(
            "body_measuring", "Body Measuring Application",
            "Research And Developer", "C#.Net, Eyeshot",
            "Provided Eyeshot based solution to automate alignment of human leg in Z+ direction and Patella in X+ direction. Also, automatic determination of patella point, knee point and ankle point."
        ),
        Project(
            "cad_generate_and_view", "CAD Generate and View",
            "Research And Developer",
            "Eyeshot, Hoops, ACIS, Teigha, C#, C++, JavaScript, HTML, ASP.NET",
            "Research based project to figure out 10 years ahead product and technology. Investigated Eyeshot, Hoops Communicator, ACIS and Teigha technologies. Generated 3D model and annotations and stored all available formats. From 3D drawing created 2D drawing of model (Top, Front and ISO views). Generated hoops xml from BXF file to views and configure models."
        ),
        Project("fbx_exporter", "FBX Exporter ", "Developer",
                "C#.Net, C++, Autodesk FBX SDK",
                "Plugin to export the Fusion360 models into FBX file format."),
        Project(
            "json_library", "JSON Library", "Developer", "C#.Net, THREE.JS",
            "Developed JSON library to export JSON format 4.5 on the top of PTS library. JSON library supports to visibility of nodes, face level color support, cumulative transformation and face level transparency."
        ),
        Project(
            "voice_360", "VOICE 360 (2 Month)", "Developer & Mentor",
            "HTML, CSS, JavaScript, Forge, BIM 360, PHP, ASP.NET",
            "Voice 360 is an application which allows you to interact with Forge Viewer and BIM 360 model using voice. It provides voice recognition feature to execute Forge Viewer commands. With the help of microphone on your system, you can give commands instead of taking inputs from mouse and keyboard. This application seamlessly integrates with an existing system and can be extended with more commands as needed. Successfully submitted the application to BIM360 Autodesk Hackathon.(http://dev.prototechsolutions.com:83/ps/voice360/index.html)"
        ),
        Project(
            "autodesk_platform_plugins", "Autodesk Platform Plugins",
            "Developer", "C#.NET, C++",
            "Project consists of 3DPDF, OBJ and WebGL exporter’s plugins for major Autodesk Platforms like Inventor, AutoCAD, Revit."
        )
    ]
    for proj in projectList:
        if proj.id == project_name:
            output = proj
            break

    #output = projectList[0]

    context = {'output': output}

    return render(request, 'project_t.html', context)
Exemplo n.º 3
0
    def load_file_content_to_db(self, fp):
        """ Take a path to markdown file,
            convert it to json
            then add content to Project db table
        """
       
        new_fname = self.convert_markdown_file_to_json(fp)

        file_content = self.parse_json_file(new_fname)
        if file_content:                
            proj = Project(**file_content)
            proj.save()
Exemplo n.º 4
0
def addproject(request, personp):
    #notifications = NotificationsField.objects.filter(person__username__contains=personp)
    if request.method == 'GET':
        context = {
            'form': AddProject,
            #'notifications': notifications,
        }
        return render(request, 'addproject.html', context)
    else:
        form = AddProject(request.POST, request.FILES)
        if form.is_valid():
            sup = Project(
                title=form.cleaned_data['title'],
                description=form.cleaned_data['description'],
                technology=form.cleaned_data['technology'],
                person=request.user,
                main_image=form.cleaned_data['main_image'],
                source_code=form.cleaned_data['source_code'],
                img1=form.cleaned_data['img1'],
                img2=form.cleaned_data['img2'],
                img3=form.cleaned_data['img3'],
            )
            #g1 = Project()
            print(sup)
            sup.save()
            #yha bhari cheez ane wali h(notifications)
            User = get_user_model()
            val = FollowersField.objects.filter(
                person__username__contains=request.user.username)
            sending_person = NewFields.objects.filter(
                person__username__contains=request.user.username)[0]
            for v in val:
                user1 = User.objects.filter(username=v.followers)[0]
                #user1 = NewFields.objects.filter(person__username__contains=v.followers)[0]
                shi_dbba = NotificationsField(
                    person=user1,
                    sender=sending_person,
                    Pid=sup.id,
                    notifications=request.user.username +
                    " recently added a project")
                shi_dbba.save()
                print(shi_dbba.notifications)
            dbba = Project.objects.filter(person__username__contains=personp)
            info = NewFields.objects.filter(person__username__contains=personp)
            context = {
                'dbba': dbba,
                'info': info,
            }
            #return render(request,'portfolio.html',context)
            return redirect(reverse('portfolio'))
Exemplo n.º 5
0
def project_new(db_session):
    """ Creates a new project. """
    data = request.get_json()

    if data is None:
        abort(400)

    if "name" not in data:
        abort(400)
    if "url" not in data:
        abort(400)
    if "show" not in data:
        abort(400)
    if "description" not in data:
        abort(400)

    project = Project(name=data["name"],
                      url=data["url"],
                      show=data["show"],
                      description=data["description"])

    try:
        db_session.add(project)
        db_session.commit()
        return ("", 204)
    except IntegrityError:
        return jsonify(**{"error": "project could not be added"})
Exemplo n.º 6
0
    def test_saving_retrieving_projects(self):
        first_project = Project()
        first_project.name = "The first ever test project"
        first_project.save()

        second_project = Project()
        second_project.name = "The second test project"
        second_project.save()

        saved_projects = Project.objects.all()
        self.assertEqual(saved_projects.count(), 2)

        first_saved_project = saved_projects[0]
        second_saved_project = saved_projects[1]
        self.assertEqual(first_saved_project.name,
                         'The first ever test project')
        self.assertEqual(second_saved_project.name, 'The second test project')
Exemplo n.º 7
0
    def _enter_projects(self):
        with open('portfolio/data/projects-full.json', 'r') as f:
            data = json.load(f)

        for row in data:
            project = Project(title=row['title'],
                              description=row['description'],
                              live_link=row['live_link'],
                              source_code=row['source_code'],
                              blog_link=row['blog_link'])
            project.save()

            image_name = row['image']
            abs_path = os.path.join(BASE_DIR,
                                    "portfolio/data/screenshots/" + image_name)

            with open(abs_path, 'rb') as f:
                django_file = File(f)
                project.image.save(image_name, django_file)
Exemplo n.º 8
0
    def test_creating_and_retrieving_projects(self):
        first_project = Project()
        first_project.title = '1st project'
        first_project.description = '1st desc'
        first_project.save()

        second_project = Project()
        second_project.title = '2nd project'
        second_project.description = '2nd desc'
        second_project.save()

        projects = Project.objects.all()
        self.assertEqual(projects.count(), 2)

        first_saved_project = projects[0]
        self.assertEqual(first_saved_project.title, '1st project')
        self.assertEqual(first_saved_project.description, '1st desc')

        second_saved_project = projects[1]
        self.assertEqual(second_saved_project.title, '2nd project')
        self.assertEqual(second_saved_project.description, '2nd desc')
Exemplo n.º 9
0
def projects():
    form = AddProjectForm()
    if form.validate_on_submit():
        project = Project(name=form.name.data,
                          year=form.year.data,
                          url=form.url.data,
                          description=form.description.data,
                          creator=current_user)
        db.session.add(project)
        db.session.commit()
        flash('Your project has been added!', 'success')
        return redirect(url_for('projects'))
    elif (not form.validate_on_submit()) and request.method == "POST":
        flash(
            'There has been an error. Click on the + button to see the error.',
            'error')
    return render_template('projects.html',
                           page_title='Projects',
                           form=form,
                           projects=current_user.projects)
Exemplo n.º 10
0
 def test_cannot_save_empty_projects(self):
     project = Project(title='', description='', link='')
     with self.assertRaises(ValidationError):
         project.save()
         project.full_clean()
Exemplo n.º 11
0
def add_entry(form_type):
    if form_type == 'testimoni':
        test_form = Testimoni_form()
        if test_form.validate_on_submit():
            if test_form.picture.data:
                pic_file = save_picture(test_form.picture.data)
                new_data = Testimonial(name=test_form.name.data,
                                       desc=test_form.desc.data,
                                       testimony=test_form.main.data,
                                       image_file=pic_file,
                                       author=current_user)
            else:
                new_data = Testimonial(name=test_form.name.data,
                                       desc=test_form.desc.data,
                                       testimony=test_form.main.data,
                                       author=current_user)
            db.session.add(new_data)
            db.session.commit()
            return redirect(url_for('main.data'))
        return render_template('new_data_test.html',
                               form=test_form,
                               type=form_type,
                               pic=True,
                               title='New Testimoni Data')
    if form_type == 'skill':
        skill_add_form = SkillForm()
        if skill_add_form.validate_on_submit():
            skilldata = Skills(sk_name=skill_add_form.skillsname.data,
                               sk_value=skill_add_form.skills.data,
                               author=current_user)
            db.session.add(skilldata)
            db.session.commit()
            return redirect(url_for('main.data'))
        return render_template('new_data_test.html',
                               form=skill_add_form,
                               type='testimoni',
                               title='New Skill Data')
    if form_type == 'project':
        projectform = ProjectForm()
        if projectform.validate_on_submit():
            for filled_data in projectform:
                if filled_data.data == '':
                    filled_data.data = None
            project_data = Project(p_name=projectform.title.data,
                                   p_description=projectform.Description.data,
                                   Organization=projectform.Organization.data,
                                   p_url=projectform.URL.data,
                                   cred_id=projectform.Credential.data,
                                   certi_url=projectform.Certificate.data,
                                   author=current_user)
            db.session.add(project_data)
            db.session.commit()
            return redirect(url_for('main.data'))
        return render_template('new_data_test.html',
                               form=projectform,
                               type='testimoni',
                               title='New Project Data')
    if form_type == 'job':
        jobform = JobForm()
        if jobform.validate_on_submit():
            if jobform.end.data == None:
                jobform.end.data = None
            else:
                jobform.end.data = datetime.strptime(
                    jobform.end.data.strftime("%B %Y"), "%B %Y")
            newjob = Job(role=jobform.role.data,
                         company=jobform.company.data,
                         start=datetime.strptime(
                             jobform.start.data.strftime("%B %Y"), "%B %Y"),
                         end=jobform.end.data,
                         place=jobform.place.data,
                         jd=jobform.jd.data,
                         author=current_user)
            db.session.add(newjob)
            db.session.commit()
            return redirect(url_for('main.data'))
        return render_template('new_data_test.html',
                               form=jobform,
                               type=form_type,
                               title='New Job Data')
Exemplo n.º 12
0
html_skill = Skill(name="HTML")
html_skill.save()

css_skill = Skill(name="CSS")
css_skill.save()

ajax_skill = Skill(name="Ajax")
ajax_skill.save()

sparklines_dash_project = Project(
    title="Real-Time Sparklines Dashboard",
    description="A real-time dashboard for quickly visualizing tends in currency "
    "fluctuations for major currencies over the past month. Developed end-to-end "
    "to display metrics in real-time. Extracts metrics from the ECB currency "
    "API, transforms data using Python's Pandas, visualizes sparklines using "
    "d3. Served using nginx and gunicorn via the Flask micro-framework.",
    link="http://sparklines-dash.rowanv.com",
    thumbnail="/static/images/sparklines_dash.png",
    tag_name="sparklines_dash",
    code_link="https://github.com/rowanv/sparklines_dash",
)
sparklines_dash_project.save()
sparklines_dash_project.skills_list.add(
    python_skill, pandas_library_skill, flask_library_skill, java_script_skill, d3_library_skill, html_skill, css_skill
)

business_dash_project = Project(
    title="Real-Time Business Dashboard",
    description="  A dynamic dashboard for visualizing a movie rental company"
    "'s key business metrics. Developed end-to-end to display metrics in real-time."
    "Extracts metrics from a MySQL database, transforms data using Python, "
Exemplo n.º 13
0
    def run_from_argv(self, *args):

        languages = (
            'PHP',
            'MySQL',
            '(X)HTML',
            'CSS',
            'Python/Django',
            'JavaScript/jQuery',
        )

        # Build Technologies
        print "Adding languages..."
        for lang in languages:
            l = Language()
            l.name = lang
            l.save()

        today = datetime.date.today()
        start = today - datetime.timedelta(weeks=15)

        print "Adding projects..."
        for i in range(4):
            if i == 0:
                i = 1

            languages = Language.objects.get(pk=i)

            p = Project()
            p.begun = start
            p.completed = today
            p.title = "Project Number %s" % (i,)
            p.slug = "project-%s" % (i,)
            p.client = "Myself"
            p.description = "I did stuff on this project"
            p.save()
            p.languages.add(languages)
            p.save()