我是awk -F, '{ print "chmod 755 "$1"" | "/bin/sh"}' file.txt
,@Entity
class MainCategory(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
var id: Long = -1,
...
@OneToMany (mappedBy = "maincategory", cascade = [(CascadeType.ALL)],
fetch = FetchType.LAZY)
var sub_category: List<SubCategory> = emptyList()
)
@Entity
class SubCategory(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,
...
@ManyToOne
@JsonIgnore
@JoinColumn(name = "maincategory_id", referencedColumnName="id")
val maincategory: MainCategory,
@OneToMany (mappedBy = "subcategory", cascade = [(CascadeType.ALL)], fetch = FetchType.LAZY)
var topics: List<Topic> = emptyList()
)
@Entity
class Topic (@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,
...
@ManyToOne
@JsonIgnore
@JoinColumn(name = "subcategory_id", referencedColumnName="id")
val subcategory: SubCategory,
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "tpc_id", nullable = false, insertable = false, updatable = false, referencedColumnName="ID")
var posts: List<Post>
)
@Repository
interface MainCategoryRepository : CrudRepository<MainCategory, Long> {
@Query("FROM MainCategory m LEFT JOIN FETCH m.sub_category s LEFT JOIN s.topics")
fun findList(): MutableIterable<MainCategory>
}
@RestController
@RequestMapping("mainCategory")
class MainCategoryController(val mainCategoryRepository: MainCategoryRepository) {
@GetMapping("/findList")
fun findList(): MutableIterable<MainCategory> {
val i: MutableIterable<MainCategory> = this.mainCategoryRepository.findList()
i.forEach{it.sub_category.forEach{ cs ->
cs.topics.forEach{it ->
it.posts = emptyList()}
}
}
return i
}
}
的新手。
我已经建立了一个脚本,该脚本可以导入我定义的功能。
当我尝试从pycharms运行脚本时,它会起作用。
通过ubuntu
执行时会引发错误
回溯(最近通话最近): 在第2行的“ /home//PycharmProjects/PMS/placeorder.py”文件中 从allpurpose.webdriver命令导入sendkeys,clickelem_id ModuleNotFoundError:没有名为“通用”的模块
cron
cron
导入来自/ home / PycharmProjects文件夹中的文件
答案 0 :(得分:0)
我发布此消息是为了防止有人跌倒进入相似的位置:
上面的错误是因为我的虚拟环境没有想要导入的脚本。我通过将脚本移至以下位置来解决了该问题:
/path/to/virtual/env/lib/python3.6/site-packages/folder
在上述情况下,/folder
是allpurpose
。