Closed aawadall closed 6 years ago
This will require some sort of mapping function
required fix: to map the existing UUID to an ID that is 4 digits max
Would an increment work? i.e. each instance of a task object has an id of one higher then the previous task. Or would this be unviable for for later tasks?
import itertools
class task():
newid = itertools.count()
def __init__(self):
self.id = next(self.newid)
Why not. Try to put it in the init and test it please
Do I test using UnitTesting?
If you can. If not we can have a second round of unit tests
I could not test from the parser as we don't have a way (or I don't fully know how) to track id yet through it. but I added a bunch o instances of tasks at the end of file and printed the task id to screen which worked in giving me a task id for each instance starting with zero.
++++++ ` import itertools
class Task: """Building block of a project plan""" type = "Task Element" taskid = itertools.count()
def __init__(self, name=None):
# Basic Information
self._id = next(self.taskid)
self._name = name
a= Task() print(a._id) b= Task() v = Task() ssd=Task() print(ssd._id) ter= Task() qwe = Task() re = Task() print(re.id)
print(a._id) ` +++++ Results: 0 3 6 0
nice, can you commit this change?
I ended up with a fork
@burhania2 can you create a pull request?
Define user friendly Task IDs, such that users can identify tasks while manipulating them using the text UI