How to use django packages in your app?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
i am making a car booking system. and beginner in web development its my first django project . i had covered poll app tutorial. i want to built a booking system . i want to use this package https://github.com/bitlabstudio/django-booking in my django application . i want to use this package features for my car booking . how do i attach and make it working with my app.
i dont know about django packages. how do i use this package for booking.what should i write and where should i write about booking . i had installed booking and covered all stuffs in Readme. but how do i initialize with my app . for eg i want to use there booking system for book my car
Views.py
class CarDetailView(DetailView):
context_object_name = 'car_details'
model = models.Car
template_name = 'buggy_app/car_detail.html'
class BookingView(FormView):
template_name = 'buggy_app/booking.html'
form_class = BookingForm
models = Booking
def form_valid(self, form):
form.save()
return super(BookingView, self).form_valid(form)
success_url = reverse_lazy('index')
def get_context_data(self, **kwargs):
try:
kwargs['car'] = Car.objects.get(id=self.request.GET.get('car', ''))
except (Car.DoesNotExist, ValueError):
kwargs['car'] = None
return super(BookingView, self).get_context_data(**kwargs)
def get_initial(self):
initial = super(BookingView, self).get_initial()
if 'car' in self.request.GET:
try:
initial['book_car'] = Car.objects.get(id=self.request.GET['car'])
except (Car.DoesNotExist, ValueError):
pass
return initial
Models.py
class Booking(models.Model):
booking_name = models.CharField(max_length=240, null=False)
customer_name = models.ForeignKey(Customer, on_delete=models.CASCADE, related_name='book_customers' )
book_car = models.ForeignKey(Car, on_delete=models.CASCADE, related_name='book_car')
booking_start_date = models.DateTimeField(auto_now_add=True, blank=False)
booking_end_date = models.DateTimeField(blank=True, null=True)
rental_price = models.IntegerField(blank=False, null=False)
times_pick = models.TimeField(blank=True)
is_approved = models.BooleanField(default=False)
def __str__(self):
return self.booking_name
def get_absolute_url(self):
return reverse("buggy_app:detail",kwargs={'pk':self.pk})
python django django-views package
add a comment |
i am making a car booking system. and beginner in web development its my first django project . i had covered poll app tutorial. i want to built a booking system . i want to use this package https://github.com/bitlabstudio/django-booking in my django application . i want to use this package features for my car booking . how do i attach and make it working with my app.
i dont know about django packages. how do i use this package for booking.what should i write and where should i write about booking . i had installed booking and covered all stuffs in Readme. but how do i initialize with my app . for eg i want to use there booking system for book my car
Views.py
class CarDetailView(DetailView):
context_object_name = 'car_details'
model = models.Car
template_name = 'buggy_app/car_detail.html'
class BookingView(FormView):
template_name = 'buggy_app/booking.html'
form_class = BookingForm
models = Booking
def form_valid(self, form):
form.save()
return super(BookingView, self).form_valid(form)
success_url = reverse_lazy('index')
def get_context_data(self, **kwargs):
try:
kwargs['car'] = Car.objects.get(id=self.request.GET.get('car', ''))
except (Car.DoesNotExist, ValueError):
kwargs['car'] = None
return super(BookingView, self).get_context_data(**kwargs)
def get_initial(self):
initial = super(BookingView, self).get_initial()
if 'car' in self.request.GET:
try:
initial['book_car'] = Car.objects.get(id=self.request.GET['car'])
except (Car.DoesNotExist, ValueError):
pass
return initial
Models.py
class Booking(models.Model):
booking_name = models.CharField(max_length=240, null=False)
customer_name = models.ForeignKey(Customer, on_delete=models.CASCADE, related_name='book_customers' )
book_car = models.ForeignKey(Car, on_delete=models.CASCADE, related_name='book_car')
booking_start_date = models.DateTimeField(auto_now_add=True, blank=False)
booking_end_date = models.DateTimeField(blank=True, null=True)
rental_price = models.IntegerField(blank=False, null=False)
times_pick = models.TimeField(blank=True)
is_approved = models.BooleanField(default=False)
def __str__(self):
return self.booking_name
def get_absolute_url(self):
return reverse("buggy_app:detail",kwargs={'pk':self.pk})
python django django-views package
1
This question is not clear. The app has a detailed readme; what do you think is not covered there? Where are you having problems?
– Daniel Roseman
Jun 26 '18 at 10:43
@DanielRoseman hi . i dont know about packages . means how do i use that package for booking . what should i write and where should i wirte about booking . i had installed all that stuffs that is in readme and dont know how to configure with my app
– user9976917
Jun 26 '18 at 10:58
add a comment |
i am making a car booking system. and beginner in web development its my first django project . i had covered poll app tutorial. i want to built a booking system . i want to use this package https://github.com/bitlabstudio/django-booking in my django application . i want to use this package features for my car booking . how do i attach and make it working with my app.
i dont know about django packages. how do i use this package for booking.what should i write and where should i write about booking . i had installed booking and covered all stuffs in Readme. but how do i initialize with my app . for eg i want to use there booking system for book my car
Views.py
class CarDetailView(DetailView):
context_object_name = 'car_details'
model = models.Car
template_name = 'buggy_app/car_detail.html'
class BookingView(FormView):
template_name = 'buggy_app/booking.html'
form_class = BookingForm
models = Booking
def form_valid(self, form):
form.save()
return super(BookingView, self).form_valid(form)
success_url = reverse_lazy('index')
def get_context_data(self, **kwargs):
try:
kwargs['car'] = Car.objects.get(id=self.request.GET.get('car', ''))
except (Car.DoesNotExist, ValueError):
kwargs['car'] = None
return super(BookingView, self).get_context_data(**kwargs)
def get_initial(self):
initial = super(BookingView, self).get_initial()
if 'car' in self.request.GET:
try:
initial['book_car'] = Car.objects.get(id=self.request.GET['car'])
except (Car.DoesNotExist, ValueError):
pass
return initial
Models.py
class Booking(models.Model):
booking_name = models.CharField(max_length=240, null=False)
customer_name = models.ForeignKey(Customer, on_delete=models.CASCADE, related_name='book_customers' )
book_car = models.ForeignKey(Car, on_delete=models.CASCADE, related_name='book_car')
booking_start_date = models.DateTimeField(auto_now_add=True, blank=False)
booking_end_date = models.DateTimeField(blank=True, null=True)
rental_price = models.IntegerField(blank=False, null=False)
times_pick = models.TimeField(blank=True)
is_approved = models.BooleanField(default=False)
def __str__(self):
return self.booking_name
def get_absolute_url(self):
return reverse("buggy_app:detail",kwargs={'pk':self.pk})
python django django-views package
i am making a car booking system. and beginner in web development its my first django project . i had covered poll app tutorial. i want to built a booking system . i want to use this package https://github.com/bitlabstudio/django-booking in my django application . i want to use this package features for my car booking . how do i attach and make it working with my app.
i dont know about django packages. how do i use this package for booking.what should i write and where should i write about booking . i had installed booking and covered all stuffs in Readme. but how do i initialize with my app . for eg i want to use there booking system for book my car
Views.py
class CarDetailView(DetailView):
context_object_name = 'car_details'
model = models.Car
template_name = 'buggy_app/car_detail.html'
class BookingView(FormView):
template_name = 'buggy_app/booking.html'
form_class = BookingForm
models = Booking
def form_valid(self, form):
form.save()
return super(BookingView, self).form_valid(form)
success_url = reverse_lazy('index')
def get_context_data(self, **kwargs):
try:
kwargs['car'] = Car.objects.get(id=self.request.GET.get('car', ''))
except (Car.DoesNotExist, ValueError):
kwargs['car'] = None
return super(BookingView, self).get_context_data(**kwargs)
def get_initial(self):
initial = super(BookingView, self).get_initial()
if 'car' in self.request.GET:
try:
initial['book_car'] = Car.objects.get(id=self.request.GET['car'])
except (Car.DoesNotExist, ValueError):
pass
return initial
Models.py
class Booking(models.Model):
booking_name = models.CharField(max_length=240, null=False)
customer_name = models.ForeignKey(Customer, on_delete=models.CASCADE, related_name='book_customers' )
book_car = models.ForeignKey(Car, on_delete=models.CASCADE, related_name='book_car')
booking_start_date = models.DateTimeField(auto_now_add=True, blank=False)
booking_end_date = models.DateTimeField(blank=True, null=True)
rental_price = models.IntegerField(blank=False, null=False)
times_pick = models.TimeField(blank=True)
is_approved = models.BooleanField(default=False)
def __str__(self):
return self.booking_name
def get_absolute_url(self):
return reverse("buggy_app:detail",kwargs={'pk':self.pk})
python django django-views package
python django django-views package
edited Jun 26 '18 at 11:01
asked Jun 26 '18 at 10:39
user9976917
1
This question is not clear. The app has a detailed readme; what do you think is not covered there? Where are you having problems?
– Daniel Roseman
Jun 26 '18 at 10:43
@DanielRoseman hi . i dont know about packages . means how do i use that package for booking . what should i write and where should i wirte about booking . i had installed all that stuffs that is in readme and dont know how to configure with my app
– user9976917
Jun 26 '18 at 10:58
add a comment |
1
This question is not clear. The app has a detailed readme; what do you think is not covered there? Where are you having problems?
– Daniel Roseman
Jun 26 '18 at 10:43
@DanielRoseman hi . i dont know about packages . means how do i use that package for booking . what should i write and where should i wirte about booking . i had installed all that stuffs that is in readme and dont know how to configure with my app
– user9976917
Jun 26 '18 at 10:58
1
1
This question is not clear. The app has a detailed readme; what do you think is not covered there? Where are you having problems?
– Daniel Roseman
Jun 26 '18 at 10:43
This question is not clear. The app has a detailed readme; what do you think is not covered there? Where are you having problems?
– Daniel Roseman
Jun 26 '18 at 10:43
@DanielRoseman hi . i dont know about packages . means how do i use that package for booking . what should i write and where should i wirte about booking . i had installed all that stuffs that is in readme and dont know how to configure with my app
– user9976917
Jun 26 '18 at 10:58
@DanielRoseman hi . i dont know about packages . means how do i use that package for booking . what should i write and where should i wirte about booking . i had installed all that stuffs that is in readme and dont know how to configure with my app
– user9976917
Jun 26 '18 at 10:58
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51040840%2fhow-to-use-django-packages-in-your-app%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51040840%2fhow-to-use-django-packages-in-your-app%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
This question is not clear. The app has a detailed readme; what do you think is not covered there? Where are you having problems?
– Daniel Roseman
Jun 26 '18 at 10:43
@DanielRoseman hi . i dont know about packages . means how do i use that package for booking . what should i write and where should i wirte about booking . i had installed all that stuffs that is in readme and dont know how to configure with my app
– user9976917
Jun 26 '18 at 10:58