MCPcopy Create free account
hub / github.com/diffgram/diffgram / Guide

Class Guide

shared/database/task/guide.py:5–89  ·  view source on GitHub ↗

A guide can be assigned a type A task can have 1? guide? A contract can have multiple guides Good guides can be shared Concept that a user may create and is likely to re use guides And likely to update over time

Source from the content-addressed store, hash-verified

3
4
5class Guide(Base):
6 """
7
8 A guide can be assigned a type
9
10 A task can have 1? guide?
11
12 A contract can have multiple guides
13
14 Good guides can be shared
15
16 Concept that a user may create and is likely to re use guides
17
18 And likely to update over time
19
20 """
21 __tablename__ = 'guide'
22 id = Column(Integer, primary_key = True)
23
24 is_visible = Column(Boolean, default = True) # Seperate "is draft" thing here or...
25
26 archived = Column(Boolean, default = False) # Hide from list
27
28 # Type
29 # (ie what tasks is this for? does that matter?)
30 # The task may care what guide it has but the guide doesn't right
31 # Or maybe it should have it...
32
33 # Maybe tags instead?
34
35 name = Column(String())
36 description_markdown = Column(String())
37
38 # samples (cached and/or link diretly to file?)
39 # other types of attachements? ?? files?
40
41 # Deferred as this could grow to be quite large.
42 history_cache = deferred(Column(MutableDict.as_mutable(JSONEncodedDict),
43 default = {}))
44
45 # attached to projects for permissions???
46 # I guess if sharing guides between projects maybe future thing?
47 project_id = Column(Integer, ForeignKey('project.id'))
48 project = relationship('Project')
49
50 member_created_id = Column(Integer, ForeignKey('member.id'))
51 member_created = relationship("Member", foreign_keys = [member_created_id])
52
53 member_updated_id = Column(Integer, ForeignKey('member.id'))
54 member_updated = relationship("Member", foreign_keys = [member_updated_id])
55
56 time_created = Column(DateTime, default = datetime.datetime.utcnow)
57 time_updated = Column(DateTime, onupdate = datetime.datetime.utcnow)
58
59 def serialize(self):
60 return {
61 'name': self.name,
62 'markdown': self.description_markdown,

Callers 1

guide_new_coreFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected