Project

Profile

Help

Issue #3217

Updated by bizhang over 6 years ago

While ArrayField h3. How to Reproduce:  

 1. Create a Repo: 
 <pre>http POST http://localhost:8000/api/v3/repositories/ name=foo </pre> 

 2. Create a python importer 
 <pre>http POST http://localhost:8000/api/v3/importers/python/ name='bleh' download_policy='immediate' sync_mode='mirror' feed_url='https://test.pypi.org' repository='http://localhost:8000/api/v3/repositories/eb96a13c-507b-4e31-9121-26ab40a68b55/' projects:='["pulpcore"]'</pre> 

 3. Update the importer 
 <pre>http PUT http://localhost:8000/api/v3/importers/python/c8b3024f-ac8a-4dcb-bb5d-67f20425066f/ name='bar' download_policy='immediate' sync_mode='additive' feed_url='https://pypi.org' repository='http://localhost:8000/api/v3/repositories/eb96a13c-507b-4e31-9121-26ab40a68b55/' projects:='["pulpcore", "Django"]'</pre> 


 The task will fail with:  
 <pre>{'projects': ['Not a valid string.']}</pre> 

 This is nice because in our update task we create a QueryDict and simple for modeling update it is postgresql only. We should not lock down on with the db to one technology. data, which results in something like:  
 <pre><QueryDict: {'projects': [['pulpcore', 'Django']], 'repository': ['http://localhost:8000/api/v3/repositories/eb96a13c-507b-4e31-9121-26ab40a68b55/'], 'feed_url': ['https://pypi.org'], 'sync_mode': ['additive'], 'name': ['bar'], 'download_policy': ['immediate']}></pre> 

Back