<s> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> from django import forms <EOL> from django . db import models <EOL> from django . utils . encoding import python_2_unicode_compatible <EOL> STATUS_CHOICES = ( <EOL> ( <NUM_LIT:0> , '<STR_LIT>' ) , <EOL> ( <NUM_LIT:1> , '<STR_LIT>' ) , <EOL> ( <NUM_LIT:2> , '<STR_LIT>' ) , <EOL> ) <EOL> class SubCharField ( models . CharField ) : <EOL> pass <EOL> class SubSubCharField ( SubCharField ) : <EOL> pass <EOL> class SubnetMaskField ( models . Field ) : <EOL> empty_strings_allowed = False <EOL> description = "<STR_LIT>" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> kwargs [ '<STR_LIT:max_length>' ] = <NUM_LIT:15> <EOL> models . Field . __init__ ( self , * args , ** kwargs ) <EOL> def get_internal_type ( self ) : <EOL> return "<STR_LIT>" <EOL> def formfield ( self , ** kwargs ) : <EOL> defaults = { '<STR_LIT>' : forms . GenericIPAddressField } <EOL> defaults . update ( kwargs ) <EOL> return super ( SubnetMaskField , self ) . formfield ( ** defaults ) <EOL> @ python_2_unicode_compatible <EOL> class User ( models . Model ) : <EOL> username = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> first_name = SubCharField ( max_length = <NUM_LIT:100> ) <EOL> last_name = SubSubCharField ( max_length = <NUM_LIT:100> ) <EOL> status = models . IntegerField ( choices = STATUS_CHOICES , default = <NUM_LIT:0> ) <EOL> is_active = models . BooleanField ( default = False ) <EOL> favorite_books = models . ManyToManyField ( '<STR_LIT>' , related_name = '<STR_LIT>' ) <EOL> def __str__ ( self ) : <EOL> return self . username <EOL> @ python_2_unicode_compatible <EOL> class AdminUser ( User ) : <EOL> class Meta : <EOL> proxy = True <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % self . username <EOL> @ python_2_unicode_compatible <EOL> class Comment ( models . Model ) : <EOL> text = models . TextField ( ) <EOL> author = models . ForeignKey ( User , related_name = '<STR_LIT>' , on_delete = models . CASCADE ) <EOL> date = models . DateField ( ) <EOL> time = models . TimeField ( ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . author , self . text [ : <NUM_LIT> ] ) <EOL> class Article ( models . Model ) : <EOL> published = models . DateTimeField ( ) <EOL> author = models . ForeignKey ( User , null = True , on_delete = models . CASCADE ) <EOL> def __str__ ( self ) : <EOL> if self . author_id : <EOL> return "<STR_LIT>" % ( self . author , self . published ) <EOL> return "<STR_LIT>" % self . published <EOL> @ python_2_unicode_compatible <EOL> class Book ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> price = models . DecimalField ( max_digits = <NUM_LIT:6> , decimal_places = <NUM_LIT:2> ) <EOL> average_rating = models . FloatField ( ) <EOL> def __str__ ( self ) : <EOL> return self . title <EOL> class Place ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> class Meta : <EOL> abstract = True <EOL> class Restaurant ( Place ) : <EOL> serves_pizza = models . BooleanField ( default = False ) <EOL> class NetworkSetting ( models . Model ) : <EOL> ip = models . GenericIPAddressField ( ) <EOL> mask = SubnetMaskField ( ) <EOL> @ python_2_unicode_compatible <EOL> class Company ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> class Meta : <EOL> ordering = [ '<STR_LIT:name>' ] <EOL> @ python_2_unicode_compatible <EOL> class Location ( models . Model ) : <EOL> company = models . ForeignKey ( Company , related_name = '<STR_LIT>' , on_delete = models . CASCADE ) <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> zip_code = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> open_days = models . CharField ( max_length = <NUM_LIT:7> ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' % ( self . company . name , self . name ) <EOL> class Account ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> in_good_standing = models . BooleanField ( default = False ) <EOL> friendly = models . BooleanField ( default = False ) <EOL> class Profile ( models . Model ) : <EOL> account = models . OneToOneField ( Account , related_name = '<STR_LIT>' , on_delete = models . CASCADE ) <EOL> likes_coffee = models . BooleanField ( default = False ) <EOL> likes_tea = models . BooleanField ( default = False ) <EOL> class BankAccount ( Account ) : <EOL> amount_saved = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> class Node ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> adjacents = models . ManyToManyField ( '<STR_LIT>' ) <EOL> class DirectedNode ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> outbound_nodes = models . ManyToManyField ( '<STR_LIT>' , <EOL> symmetrical = False , <EOL> related_name = '<STR_LIT>' ) <EOL> class Worker ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> class HiredWorker ( models . Model ) : <EOL> salary = models . IntegerField ( ) <EOL> hired_on = models . DateField ( ) <EOL> worker = models . ForeignKey ( Worker , on_delete = models . CASCADE ) <EOL> business = models . ForeignKey ( '<STR_LIT>' , on_delete = models . CASCADE ) <EOL> class Business ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> employees = models . ManyToManyField ( Worker , <EOL> through = HiredWorker , <EOL> related_name = '<STR_LIT>' ) <EOL> class UUIDTestModel ( models . Model ) : <EOL> uuid = models . UUIDField ( ) <EOL> class SpacewalkRecord ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> astronaut = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> duration = models . DurationField ( ) </s>
