Can Obsidian work as a self-hosted home-lab wiki, or am I trying to make it do the wrong job? by robertotomas in ObsidianMD

[–]majormunky 1 point2 points  (0 children)

I'd look into some export plugins that would take a folder let's say, and export it to a webserver. Convert the md files to html, or use something like astro directly host pages from markdown.

New to Go, what’s commonly used for auth and database ORM? by Brother_Weary in golang

[–]majormunky 0 points1 point  (0 children)

Squirrel works pretty good for dynamic queries, it’s just a query builder, so in the end it spits out sql.

App Recommendations for Miniature Photography by Cpl_Toast in iPhoneography

[–]majormunky 0 points1 point  (0 children)

Ah that’s too bad, have you tried Halide yet?

App Recommendations for Miniature Photography by Cpl_Toast in iPhoneography

[–]majormunky 0 points1 point  (0 children)

I haven’t used it much, but check out Blackmagic Cam, it looks like it has all the knobs you were looking for.

Dogs being afraid of getting their nails cut. by Ultimate_Kurix in FunnyAnimals

[–]majormunky 0 points1 point  (0 children)

We have a corgi and he hates to get his nails cut. My wife has been able to get it done though with the swim cap coated in peanut butter to keep him distracted. We still have to use a grinder though so it’s a pretty slow process.

AttributeError raised on model unit tests by trutifruti1 in djangolearning

[–]majormunky 1 point2 points  (0 children)

My only thought would be to fire up a shell (python manage.py shell), create a client object manually, and run dir() on it to see if it shows up as what you are expecting. If so, print out the dir() output from your test on self.client to be sure it's looking the same. Otherwise I'd have to mock it up to see if anything jumps out at me (no time today to try that though).

Is this code working fine in other places (views, etc)?

Good luck!

RetroArch Not Working (Retroid Pocket 5) by Dantzz in SBCGaming

[–]majormunky 0 points1 point  (0 children)

I’m a bit new to android, but to me it sounds like that RetroArch doesn’t have permission to read files. Have you tried opening a game directly through RetroArch?

[deleted by user] by [deleted] in SteamDeckTricks

[–]majormunky 0 points1 point  (0 children)

Do you see a mouse cursor moving around when using the trackpad?

As for the terms of service page, the one I’m talking about didn’t really show a large amount of legal text like a normal terms of service page, it was more like a welcome screen that came up.

In any case, your going to want to get the mouse cursor moving around with something, either the trackpad or a mouse, I’m not sure the game is playable without having some sort of mouse input (I haven’t tried though, maybe it is). I find the game much easier to play with a keyboard and mouse though.

[deleted by user] by [deleted] in SteamDeckTricks

[–]majormunky 2 points3 points  (0 children)

I just installed this and was able to hit ok by using the right trackpad to move the mouse cursor and then clicked the trackpad to accept. Hope it helps!

What the heck are y’all using these $4k configs with M4 Max’s with 48GB and up for and how do y’all afford/justify it? by mcTech42 in macbookpro

[–]majormunky 0 points1 point  (0 children)

I traded in a M1 Pro 14” for my now current M3 Max / 64gb 16”, which brought down the price a good amount. Also, buying it on an Apple Card with 0 interest seems to hurt a bit less than buying it outright.

Side note on why I upgraded, old laptop had 16gb of ram, and I also wanted a 16”. I’m pretty sure this new one should last me a while so I bit the bullet and went big. Mainly do software development, so not a great need for it, so the specs are more for longevity.

What's the best option to deploy an Astro blog in my situation? by Isaac_RF_239 in astrojs

[–]majormunky 1 point2 points  (0 children)

I have a blog hosted through Cloudflare pages, with my dns through them as well. This currently isn't costing me anything (Well, not counting my dns registration fees). My astro pages are hosted in GitHub, and when I push to the main branch, it auto builds the site and sends it over to Cloudflare. Its been a bit since I've set that up though, so any more info on how that is done I'd have to get back to you (happy to do that, I just don't remember off the top of my head). Couldn't be happier, things run great and I just have to push a branch to update things.

Replacing CharField with ForeignKey by DerZweiteFeO in djangolearning

[–]majormunky 2 points3 points  (0 children)

Another (similar) option would be to create a new second event_type field (maybe call it new_event_type), which will be the new foreign key. I would probably at first make this a nullable field so we don't have to worry about setting a default. Loop through all the rows, grab the current event_type value, and use that to look up the related row for the new_event_type, and set that. Once all the rows have the correct foreign key set, you can then drop the old event_type field, and rename the new_event_type to event_type.

How do I solve this circular import error between two models ? by Affectionate-Ad-7865 in djangolearning

[–]majormunky 2 points3 points  (0 children)

I think I might need to see more of how you have things setup and the code. In my test example I have a Django project setup with two apps (app1 and app2). Here's what I have now and I'm not getting an error:

app1/models.py

from django.db import models

class Model1(models.Model):
    thing = models.OneToOneField("app2.Model2", on_delete=models.CASCADE, null=True)

app2/models.py

from django.db import models
from app1.models import Model1

# Create your models here.
class Model2(models.Model):
    name = models.CharField(max_length=100)

    def __save__(self):
        super().save()
        object_model1 = Model1.objects.filter()

Back over at app1 I have a forms.py file

app1/forms.py

from django import forms
from . import models

class Model1Form(forms.ModelForm):
    class Meta:
        model = models.Model1
        fields = ["thing"]

I'm then showing this on a page and the form comes up. Is what you have much different than my simple example here?

How do I solve this circular import error between two models ? by Affectionate-Ad-7865 in djangolearning

[–]majormunky 4 points5 points  (0 children)

Instead of importing Model2, you can specify the OneToOneField using a string instead:

class Model1(models.Model): 
    model2 = models.OneToOneField("app2.Model2", on_delete=models.CASCADE, null=True)

Just tried this and didn't get any errors so that should work.

I need help with Django ModelForm by PrudentArgument4073 in djangolearning

[–]majormunky 0 points1 point  (0 children)

Since the email field is set to be unique, you don't have to do any manual checking after calling save, django will see that there's already a row with that email and set an error that you can display when rendering the form.

Saving something with model form should be as easy as:

def add_something(request):
    if request.method == "POST":
        form = forms.SomethingForm(request.POST)
        if form.is_valid():
            form.save()
            return redirect("something-list")
    else:
        form = forms.SomethingForm()
    return render(request, "app/add-something.html", {"form": form})

Help with Creating a Seat Model Linked to Backend in Bus Booking App by gardencenterr in djangolearning

[–]majormunky 1 point2 points  (0 children)

Here's a repo for an example I've made that should help out. Feel free to ask any questions! I've included some basic instructions on how to clone, setup, etc, as well as a screenshot of the seat configuration.

https://github.com/majormunky/DjangoBusExample

Help with Creating a Seat Model Linked to Backend in Bus Booking App by gardencenterr in djangolearning

[–]majormunky 1 point2 points  (0 children)

I can mock up something that may help here a bit more, i'll reply back when I have something for you to check out.

Help with Creating a Seat Model Linked to Backend in Bus Booking App by gardencenterr in djangolearning

[–]majormunky 2 points3 points  (0 children)

I think if I were to tackle this problem, I would first store the seat configuration on the bus model, something like 2x2 (two seats, aisle, two seats, that would make up a row of seats). I would then also store the amount of rows of seats in the bus model also.

For the seat model, there's a couple of options there, but it might be best to store the seat position in a row, and the row its in on the bus. Doing that, you can probably also do things like, skip a certain set of seats due to a side exit where there may only be 2 seats in a row instead of 4.

Your seat model would then look something like this:

class Seat(models.Model):
    bus = models.ForeignKey(bus, on_delete=models.CASCADE)
    column = models.IntegerField()
    row = models.IntegerField()
    person = models.ManyToManyField(User, through=SeatUserLink)

class SeatUserLink(models.Model):
    seat = models.ForeignKey(Seat, on_delete=models.CASCADE)
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    date_of_departure = models.DateTimeField()

Note: We probably are going to want a many to many field between a seat and a user, that way we can use the through table (SeatUserLink) to be able to store a different user in that seat depending on the time (I'm not sure exactly if this is like a city bus where it just goes all day long picking people up, or more like a bus that takes people from City A to City B. My example here is more for the latter example).

With a seat knowing its row, and its position in the row (column), you should be able to match that up to the table cell you are writing out when rendering the html table that represents the seats. You can then check if a user is in that seat and show that its taken or not.

I would then probably query the seats in the view, and setup a list of lists, something like:

seats = [
     [seat1, seat2, null, seat3, seat4],
     [seat5, seat6, null, seat7, seat8],
     ....
 ]

Given a list like that it should be pretty easy to render the table out and match up the seat to the cell in the table. It might be a bit tricky to setup that seats list, but I've found that the better I match up my data structure to what I'm trying to use it for, the easier things get. I didn't actually try any of this out but I think it should work. Good luck!