These are chat archives for django/django

30th
Apr 2016
karim amer
@karimamer
Apr 30 2016 00:10
i can’t figure out how to resolve this error
Got AttributeError when attempting to get a value for field `trailertype_set` on serializer `TruckSerializer`.
The serializer field might be named incorrectly and not match any attribute or key on the `Truck` instance.
Original exception text was: 'Truck' object has no attribute 'trailertype_set'.
karim amer
@karimamer
Apr 30 2016 00:16
here is the code
class TruckSerializer(GeoFeatureModelSerializer):
    trailertype_set = load_choice_serializer(many=True)

    class Meta:
        model = Truck
        geo_field = "origin"
        geo_field = "destination"
        fields = ('destination', 'origin','city', 'state', ‘trailertype_set’)

    def create(self, validated_data):
      trailertype_data = validated_data.pop('trailertype_set')
      truck = Truck.objects.create(**validated_data)
      for item in trailertype_data:
        Truck.objects.create(truck =truck , **trailertype_data)
      return truck
Alain Abrahan Paz
@clust3rsekt0r_twitter
Apr 30 2016 05:52
your traylertype_set is using wrong quotes I beleive
believe
in fields
fields =
karim amer
@karimamer
Apr 30 2016 06:14
that was a typo in the example sorry
Seti
@setivolkylany
Apr 30 2016 08:13
Who knows the completed list types of Fakers of factoryboy in django?
Anagha Todalbagi
@AnaghaTodalbagi_twitter
Apr 30 2016 08:57
@natsn - Have you tried the collectstatic command?
Hello all,
My mentee and I followed the DjangoGirls tutorial and we're ready with the Django blog on the local setup. We have pushed this code onto pythonanywhere.com. The local SQLite3 database has been populated with the blog posts we want to publish on the web, however, we are having difficulty in accessing the SQLite3 database on pythonanywhere.com bash console. We have a blog_data.dmp db dump file that we want to unpack on pythonanywhere.com. Has anybody experimented with this before? Any pointers on how to proceed to access SQLite3 db on pythonanywhere.com will help us complete our goal of publishing the blog on the internet :D Will wait to hear from you guys, thank you :D
Mauro Oviedo
@moviedo
Apr 30 2016 14:30
@AnaghaTodalbagi_twitter I’m not sure where pythonanywhere places teh location of the sqlite file but it u find it, should be based on your settings.py Database config, just use the sqlite3 my_database_file.db command
Alex
@ajbeach2
Apr 30 2016 21:03
arg, nested relations are so much easier in rails :|