mirror of
				https://github.com/graphql-python/graphene-django.git
				synced 2025-10-30 15:37:28 +03:00 
			
		
		
		
	* Fix for issue #1385: Update mutation.py to serialize Enum objects into input values for ChoiceFields * Update graphene_django/rest_framework/mutation.py Co-authored-by: Steven DeMartini <1647130+sjdemartini@users.noreply.github.com> --------- Co-authored-by: Steven DeMartini <1647130+sjdemartini@users.noreply.github.com>
		
			
				
	
	
		
			28 lines
		
	
	
		
			665 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			665 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from django.db import models
 | |
| 
 | |
| 
 | |
| class MyFakeModel(models.Model):
 | |
|     cool_name = models.CharField(max_length=50)
 | |
|     created = models.DateTimeField(auto_now_add=True)
 | |
| 
 | |
| 
 | |
| class MyFakeModelWithPassword(models.Model):
 | |
|     cool_name = models.CharField(max_length=50)
 | |
|     password = models.CharField(max_length=50)
 | |
| 
 | |
| 
 | |
| class MyFakeModelWithDate(models.Model):
 | |
|     cool_name = models.CharField(max_length=50)
 | |
|     last_edited = models.DateField()
 | |
| 
 | |
| 
 | |
| class MyFakeModelWithChoiceField(models.Model):
 | |
|     class ChoiceType(models.Choices):
 | |
|         ASDF = "asdf"
 | |
|         HI = "hi"
 | |
| 
 | |
|     choice_type = models.CharField(
 | |
|         max_length=4,
 | |
|         default=ChoiceType.HI.name,
 | |
|     )
 |