Exemplo n.º 1
0
    def handle(self, *args, **options):
        management.call_command('makemigrations', django_micro.get_app_label())
        management.call_command('migrate', run_syncdb=True)
        with ContentFile('foo', name='foo') as f:
            p = Post.objects.create(title='foo', file=f)

        print('cf closed?', f.closed)
        print('same?', f is p.file)
        print('closed?', p.file.closed)
        print('content', p.file.read())
        print('closed?', p.file.closed)
        print('cf closed?', f.closed)
        print('#######################')
        """
Exemplo n.º 2
0
 class Meta:
     app_label = django_micro.get_app_label()
Exemplo n.º 3
0
 class Meta:
     app_label = get_app_label()
     ordering = ['-id']
Exemplo n.º 4
0
 class Meta:
     app_label = get_app_label()
     ordering = ('-create_date',)
Exemplo n.º 5
0
 class Meta:
     app_label = get_app_label()
Exemplo n.º 6
0
 class Meta:
     db_table = 'assets'
     app_label = get_app_label()