Skip to content

Create multiple saleorder

I am trying to create multiple sale order based on a input field (product_quantity) in crm.lead. I am receiving the following error as pop up Answer @Khelili, thanks for sharing it. Adding a context worked fine for me. I got it somewhere by googling.

AttributeError: module ‘datetime’ has no attribute ‘strftime’

I’ve been trying to get today’s year, month, and day using datetime. So, I imported the datetime module using import datetime. However, I also needed the timedelta command, so I used from datetime import timedelta. I’m also using strftime, which I believe is gotten from from datetime import …

Scaling / Normalizing pandas column

I have a dataframe like: I’d like to create a newly scaled column in the dataframe called SIZE where SIZE is a number between 5 and 50. For Example: I’ve tried but got Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a sin…

Grouping tests in pytest: Classes vs plain functions

I’m using pytest to test my app. pytest supports 2 approaches (that I’m aware of) of how to write tests: In classes: test_feature.py -> class TestFeature -> def test_feature_sanity In functions: test_feature.py -> def test_feature_sanity Is the approach of grouping tests in a class needed…

Crawling IMDB for movie trailers?

I want to crawl IMDB and download the trailers of movies (either from YouTube or IMDB) that fit some criteria (e.g.: released this year, with a rating above 2). I want to do this in Python – I saw that there were packages for crawling IMDB and downloading YouTube videos. The thing is, my current plan is…

Python prefix to infix notation using a stack data structure

I have an assignment problem on using a stack data structure to solve problems. I am prompted to make the following stack function. Task: Using the stack you created, write the function prefix_infix that takes in a prefix expression (represented as a list) and returns the expression in fully parenthesized inf…