|
|
@@ -169,7 +169,6 @@ class Product(models.Model):
|
|
|
plz = CharField ( 'Postleitzahl', max_length = 64, help_text="PLZ des Projektes", null = True, blank=True )
|
|
|
adresse_zusatz = CharField ( 'Adresse Zusatz', max_length = 128, help_text="Adresse Zusatz", null = True, blank=True )
|
|
|
ort = CharField ( 'Ort', max_length = 4, choices=ORT, default='WELT', help_text="Beispiel: Wien, 22", null = True, blank=True )
|
|
|
-
|
|
|
type = CharField ( 'Type', max_length = 4, choices=TYPE, default='BASE', help_text="", null = True, blank=False )
|
|
|
website = URLField ( 'Website', max_length = 2048, help_text="Beispiel: https://seestern-aspern.at/", null = True, blank=True )
|
|
|
email = EmailField ( 'Email', max_length = 2048, help_text="Email des Projektes", null = True, blank=True )
|
|
|
@@ -184,18 +183,9 @@ class Product(models.Model):
|
|
|
contact = ForeignKey(Contact, null = True,on_delete=models.SET_NULL, help_text="")
|
|
|
|
|
|
|
|
|
- # title = CharField('Product Title',max_length = 100,null = True, blank=True)
|
|
|
- # year = IntegerField('Year of Completion',null = True, blank=True, help_text="")
|
|
|
- # owner = CharField(max_length = 300,null = True,blank=True, help_text="")
|
|
|
- # class_cid = CharField(null = True,max_length = 3, blank=True, help_text="")
|
|
|
- sumbitted = CharField(null = True,max_length = 10, blank=True, help_text="")
|
|
|
- date_submitted = DateField(auto_now_add=True, help_text="")
|
|
|
- #
|
|
|
- # photo = CharField(max_length=500, null=True, blank=True, help_text="")
|
|
|
- # videocts = CharField(max_length=500, null=True, blank=True, help_text="")
|
|
|
- # category = ManyToManyField(Category, help_text="",null = True, blank=True)
|
|
|
- # credits = ForeignKey(Credit, null = True, blank=True, on_delete=models.SET_NULL, help_text="")
|
|
|
- #interaction = ForeignKey(Interaction, null = True,on_delete = models.SET_NULL, help_text="")
|
|
|
+ sumbitted = CharField(null = True,max_length = 10, blank=True, help_text="")
|
|
|
+ date_submitted = DateField(auto_now_add=True, help_text="")
|
|
|
+
|
|
|
|
|
|
|
|
|
def user_can_manage(self, user):
|
|
|
@@ -263,6 +253,7 @@ class MobilitaetsProjekt(Product):
|
|
|
return "Mobilitätsprojekt"
|
|
|
|
|
|
|
|
|
+
|
|
|
class ErnaehrungsProjekt(Product):
|
|
|
|
|
|
@property
|
|
|
@@ -270,6 +261,7 @@ class ErnaehrungsProjekt(Product):
|
|
|
return "Ernährungsprojekt"
|
|
|
|
|
|
|
|
|
+
|
|
|
class EnergyProjekt(Product):
|
|
|
|
|
|
@property
|
|
|
@@ -506,14 +498,10 @@ def auto_delete_file_on_delete(sender, instance, **kwargs):
|
|
|
if os.path.isfile(instance.image_norm.path):
|
|
|
os.remove(instance.image_norm.path)
|
|
|
#
|
|
|
- #print(settings.MEDIA_ROOT+'/marktplatz/media/{0}/{1}'.format(instance.Product.id, instance.image.name))
|
|
|
- #print(instance.Product.id, instance.image.path)
|
|
|
#os.remove(settings.MEDIA_ROOT+'/marktplatz/media/{0}/{1}_big'.format(instance.Product.id, instance.filename))
|
|
|
#os.remove(settings.MEDIA_ROOT+'/marktplatz/media/{0}/{1}.jpg'.format(instance.Product.id, instance.image.name))
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
class Video(models.Model):
|
|
|
product = ForeignKey(Product, on_delete=models.CASCADE)
|
|
|
name_for = CharField(blank=True, max_length=256)
|
|
|
@@ -534,19 +522,6 @@ def auto_delete_video_on_delete(sender, instance, **kwargs):
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-# class Vote(models.Model):
|
|
|
-# product = ForeignKey(Product, on_delete=models.CASCADE)
|
|
|
-# juryMember = ForeignKey(User, on_delete = models.CASCADE)
|
|
|
-# vote = PositiveSmallIntegerField(default=0)
|
|
|
-# comment = CharField(blank=True, max_length =300)
|
|
|
-#
|
|
|
-# def __iter__(self):
|
|
|
-# for field in self._meta.fields:
|
|
|
-# yield (field.verbose_name, field.value_to_string(self))
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
class Credit(models.Model):
|
|
|
owner = CharField(verbose_name='Building or Product owner',blank=True,max_length = 300)
|
|
|
architecture = CharField(verbose_name='Architecture',blank=True,max_length = 300)
|